"If you told me that [earlier], I wouldn't have believed you," starter Tim Lincecum said.
With the Dodgers getting swept by the Brewers in Los Angeles, the Giants also closed to within 3 1/2 games of the National League West leaders. They also expanded their lead for the second NL Wild Card spot to 1 1/2 games over the Pirates and remained 1 1/2 games behind St. Louis for the first Wild Card.
The Phillies struck first in a first inning that featured Lincecum having the command of a substitute teacher (16 of 29 pitches were balls), but he escaped with minimal damage (one run) inflicted, aided by Andrew Susac thwarting Ben Revere's stolen-base attempt.
After allowing six steals in his last outing against the Royals, Lincecum utilized his slide-step more with runners on base, and the adjustment paid off.
"You get caught up in your emotions, things slip by him and all of a sudden they have six stolen bases," Susac said when asked about the difference with Lincecum. "He did a great job today and showed me he cared, which is awesome."
Yusmeiro Petit began warming up in the third after Lincecum ran into more trouble. The Phillies loaded the bases with two out and tied the game at 2 when Lincecum walked home Cody Asche.
Lincecum remained precariously effective in his five innings. Forty-six of his 97 pitches were balls, but he effectively maneuvered around the big inning and got the win after being tagged for just two earned runs on seven hits.
"That game could've been out of hand. He found a way to keep them at bay and get through five," manager Bruce Bochy said. "I'll be honest: I didn't know if he was going to make it."
Said Lincecum: "I know I didn't have my best stuff, but I worked with what I had and we got out of some big innings."
The Giants offense didn't have any big innings, but major contributions from the bottom half of the order were sufficient.
Brandon Crawford entered Sunday with a .081 average in his previous 11 games, but an RBI single in the second scored Michael Morse, and Susac scored on an ensuing throwing error by Marlon Byrd.
A Susac RBI single in the fourth scored Morse and proved to be the game-winner. Crawford and Joaquin Arias added sacrifice flies in the eighth.
Sunday was a continuation of Morse's recent hot streak, as he went 3-for-3 with three singles. He was pulled for defensive purposes in the sixth, but finished the homestand 9-for-14 with a home run, triple, two doubles and four RBIs.
"I'm getting hits," Morse quipped when asked what's been different. "I'm trying to just get my pitch to hit and put it in play."
Philadelphia hitters didn't do much of that against the Giants' bullpen.
The bullpen was again flawless Sunday. Javier Lopez struck out three and allowed just one hit in 1 2/3 innings, Jean Machi struck out the lone batter he faced and the eighth- and ninth-inning combination of Sergio Romo and Santiago Casilla secured the victory. They recorded nine strikeouts.
The bullpen threw nine scoreless innings in the last two games.