Colin Rea (5-3) pitched six strong innings for the Padres, who snapped a three-game losing streak and handed the Yankees their fourth loss in six games.
The Padres, who traded closer Fernando Rodney to Miami on Thursday, then gave up four runs in the ninth.
After Matt Thornton allowed pinch-hitter Alex Rodriguez's RBI single that pulled the Yankees to 7-3, Brandon Maurer came on with two on and none out in the ninth. He allowed Didi Gregorius' RBI double and Aaron Hicks' RBI groundout before his wild pitch brought in another run. Pinch-hitter Carlos Beltran doubled and advanced on Jacoby Ellsbury's groundout before Maurer got Brett Gardner to ground out to earn his first save.
Nathan Eovaldi (6-6) allowed six runs and seven hits in 4 1/3 innings.