In San Diego, pinch hitter Kurt Bevacqua highlighted a three-run eighth inning with a one-out, bases-loaded single.
Steve Garvey and Terry Kennedy hit consecutive singles to lead off the eighth off Ed Farmer (0-3). One out later, Farmer's wild pitch put runners at second and third.
Luis Salazar was intentionally walked to load the bases and Tug McGraw was brought in to face Bevacqua, who hit what appeared to be a routine fly ball to short center. But the ball fell between Von Hayes and second baseman Larry Milbourne and was ruled a single as Garvey crossed the plate with the tie-breaking run.
Sixto Lezcano followed with a sacrifice fly to make it 7-5 and Salazar came in to score the final run of the inning when right fielder Pete Rose's throw got by catcher Bo Diaz for an error on the Phillies' backstop.
Gary Lucas (2-3) worked the final 1 2/3 innings for the victory.
Alan Wiggins broke a 4-4 tie in the seventh with an RBI single. But the Phillies tied it in the eighth on Rose's sacrifice fly.
The Phillies, losers of five in a row, managed eight hits off five pitchers, including consecutive fourth-inning home runs by Mike Schmidt and tony Perez.