His one-out hit was the fourth double hit by San Francisco in a four-run sixth.
Pablo Sandoval and John Bowker had one RBI apiece and Bengie Molina had three of the nine hits for the Giants, who have split their last four games.
Winner Matt Cain (11-2) yielded a run and five hits in seven innings with two walks and eight strikeouts. Closer Brian Wilson finally squelched a two-run Pittsburgh rally in the eighth to record his 24th save.
Pittsburgh's Ryan Doumit had two RBI. Brandon Moss added a solo homer for the Pirates, who also have split their last four outings.
Losing pitcher Zach Duke (8-9) surrendered four runs and seven hits in seven innings with a walk and five strikeouts.
Copyright 2009 by United Press International.