Updated

Guillermo Quiroz's pinch-hit home run in the 10th inning gave the San Francisco Giants a 10-9 win over the Los Angeles Dodgers in the second of a three-game set.

In the 10th off of Brandon League (0-1), Quiroz pulled an 0-2 splitter deep over the left field wall for the victory.

Andres Torres hit a solo home run, Gregor Blanco drove in three, while Pablo Sandoval finished the game 3-for-4 with an RBI and three runs scored for the Giants, who have won five straight.

Ryan Vogelsong lasted just 4 2/3 innings as he gave up seven runs on nine hits while Santiago Casilla (3-2) got the win for pitching two scoreless innings.

"We definitely battle to the very end every night and that's a great quality to have in a team," Vogelsong said.

A.J. Ellis hit a solo home run while Dee Gordon and Matt Kemp each drove in two runs for the Dodgers, who have dropped three straight and four of five.

Matt Magill was tagged for five runs on six hits in just 1 1/3 innings in the brief start.

Buster Posey's two-run double and an RBI single from Blanco in the first gave the Giants an early 3-0 lead, and it was 5-0 after two innings as a wild pitch scored Marco Scutaro and Blanco's sacrifice fly plated Pablo Sandoval.

Ellis' solo home run in the fourth got the Dodgers on the board, but the Giants got the run back in the bottom of the frame on a run-scoring fielder's choice off the bat of Blanco.

A big fifth inning saw the Dodgers surge ahead. With one out, Kemp got the scoring started with a two-run single and back-to-back singles from Skip Schumaker and Juan Uribe later in the frame each drove in a run.

Jean Machi then took over for Vogelsong and Gordon greeted him with a triple to center to give the Dodgers the lead and it was an 8-6 game as Nick Punto followed with a double.

The Giants got one back in the fifth on Torres' first homer of the season, a solo shot to center, and tied the game in the sixth as a wild pitch from Paco Rodriguez scored Posey.

A fielder's choice groundout from Carl Crawford in the seventh again put the Dodgers on top, 9-8, as Gordon, who had walked, moved to second on a sac bunt and stole third, crossed the plate.

However, the Giants tied the contest at 9-9 in the seventh as Francisco Peguero doubled to start the inning off of Ronald Belisario, moved to third on a Scutaro groundout and came home thanks to a sac fly from Sandoval.

The Giants loaded the bases with one out in the ninth, but Posey hit into a 4-3 double play to end the frame and send it to extra innings.

Game Notes

Each team had 15 hits in the game ...Los Angeles went 6-for-13 with runners in scoring position and left 11 on base, while San Fran batted just 5-for-17 with RISP and left 13 ... The Giants have won four of the five games against the Dodgers this season.