Gerardo Parra extended his hitting streak to 13 games, matching his career high, but the Brewers were shut out for the 12th time this season.
San Francisco’s defense played a big part in that.
Pence chased down Hernan Perez’s deep fly ball to the gap in right-center for the first out in the third, then doubled up Jonathan Lucroy trying to tag up from second base on Ryan Braun’s fly out in the fourth.
"If you looked at my throw last night, I would have challenged myself," Pence said. "With the wind, I really didn’t even get behind the ball too great. I just threw up kind of a prayer up there and Duffy made an excellent tag."
Left fielder Nori Aoki followed Pence’s gem with a tumbling catch near the foul line to end the inning.
Neither team did much until the Giants sent 10 men to the plate in the fourth.
Pence hit his tiebreaking double off Milwaukee starter Mike Fiers (5-9), who struck out five and gave up two runs in six-plus innings.
San Francisco scored three runs off reliever Will Smith to break it open.
"The one inning got away from us," Fiers said. "Peavy pitched well. With our lineup, you expect to get runs, but he battled."
Peavy gave up four hits and had three strikeouts over six innings but left without the decision. Peavy reached on a single in the third — San Francisco’s first hit of the game.
"He had really good stuff," Giants manager Bruce Bochy said. "He kept it down, hit his spots. He’s been throwing the ball very well since he’s come back."
Brewers: Braun returned to the lineup after missing two days with tightness in his lower back. Braun went 0 for 4 while batting third.
Brewers righty Jimmy Nelson (8-9) will seek his first career win against the Cubs when he faces them on Thursday night in Milwaukee. Nelson is winless in four previous starts against Chicago.