PHOENIX — Pablo Sandoval hit a two-run homer with one out in the top of the ninth inning and the San Francisco Giants rallied to beat the Arizona Diamondbacks 2-1 on Tuesday night.
Arizona starter Trevor Cahill left after allowing a leadoff single to Angel Pagan, the Giants' fourth hit against the right-hander. J.J. Putz (2-1) came on for Arizona and struck out Marco Scutaro, and quickly went ahead 0-1 on Sandoval.
But Sandoval drove Putz's next pitch, a hanging split-finger fastball, deep into the right-field stands to give the Giants the lead and hand the struggling Diamondbacks closer his fourth blown save in nine chances.
Sandoval left Monday's game with discomfort in his right elbow after hitting an RBI single in the fifth inning, but was back in the starting lineup.
It was San Francisco's second straight come-from-behind victory, rallying for a 6-4 win in the series opener Monday.
Sandy Rosario (1-0) recorded the last out of the eighth inning for his first career win, and Sergio Romo pitched the ninth for his 10th save.
Josh Wilson had given the Diamondbacks a 1-0 lead with a home run in the bottom of the eighth off Santiago Casilla, who had come on after Madison Bumgarner threw seven scoreless innings. It was Wilson's first homer since June 25, 2011, for Milwaukee at Florida.
The late-inning power display was in sharp contrast to the game's first 7 1/2 innings. Bumgarner allowed three hits, walked one and struck out two before giving way for a pinch-hitter when his spot in the lineup came up in the eighth.
Cahill's line to that point was slightly better, with five strikeouts to go with the three hits and one walk through eight innings.
Only two players had reached base during the game for either side, both in the fourth. Scutaro singled to lead off the inning for the Giants and went to third on a single and fielder's choice, while Martin Prado singled to start the bottom of the inning and advanced on a two-out single.
The pitchers' duel was nothing new for Cahill, who has pitched in only one game decided by more than two runs so far. In his last four starts, both teams have combined for an average of 4.0 runs per game, including a 1-0 victory over Los Angeles on April 14 in which Cahill earned a no-decision after trading zeroes with Josh Beckett for just over seven innings.
Over his past two starts, Cahill has allowed two runs — one earned — on eight hits over 13 innings.
Bumgarner struck out two, threw 62 of 102 pitches for strikes and lowered his ERA to 1.55.