Cain outpitches Gallardo in Giants' 3-2 victory
Juan Uribe homered to spark a two-run rally in the fourth inning and San Francisco won for the sixth time in eight games. The Giants began the day one game behind Colorado for the NL wild card. The Rockies hosted Arizona later.
Cain (13-4) scattered four hits and pitched into the eighth inning, matching his career high for wins after going seven starts without one.
On Sunday, San Francisco will try to sweep the Brewers in Miller Park for the first time in nearly five years.
This one got interesting late, when Cain came out to start the eighth after getting through a rocky seventh.
Leading 3-1, the right-hander allowed a leadoff double to Jason Kendall and was pulled for reliever Jeremy Affeldt. Kendall moved to third on pinch-hitter Mike Cameron's groundout and scored on Felipe Lopez's infield single to cut the lead to one.
Affeldt then threw the ball into center field for an error on pinch-hitter Jason Bourgeois' tapper back to the mound, putting runners on second and third. But closer Brian Wilson got Ryan Braun to hit into a fielder's choice and Prince Fielder, who drove in his major league-leading 122nd run in the fourth, hit a bouncer that second baseman Eugenio Velez flipped to Uribe at second to end the threat.
Wilson worked around a one-out single by Jody Gerut in the ninth for his 34th save this season and the fourth five-out save of his career. Gold Glove center fielder Aaron Rowand and right fielder Randy Winn collided on the final out, a fly ball caught by Rowand after Winn slowed down at the last moment.
Cain, who hadn't won since July 24, was sharp through the first six innings, retiring 10 of his first 11 batters and striking out the side in the third. He finished with five strikeouts and worked around consecutive walks to start the seventh.
Uribe homered off Gallardo (12-11) with two outs in the fourth. Nate Schierholtz followed with a single and scored when Rowand doubled down the left-field line. Winn's run-scoring double in the fifth made it 3-1.
Gallardo, who pitched six solid innings, struck out six and is eight strikeouts from becoming the fourth Brewers pitcher with 200 in a season.
NOTES: Milwaukee Mayor Tom Barrett, attacked by a man with a metal bar last month, threw out the first pitch with his left hand. The 55-year-old mayor suffered gashes to his head and face, smashed teeth and shattered his right hand after responding to a grandmother's cry for help. ... Brewers RHP Dave Bush will make his scheduled start Monday after having his right arm re-examined. Bush has spent time on the disabled list and has struggled since being struck by a liner on June 4.