Updated

Angel Pagan drove in the winning run in the eighth inning as the San Francisco Giants rallied for a 9-6 win over the Colorado Rockies in the second game of a three-game set.

Brandon Crawford hit a three-run home run and scored twice while Hunter Pence drove in a pair of runs for the Giants, who have taken the first two games of this series.

Tim Lincecum was tagged for six runs on four hits with four walks and seven strikeouts over six innings of work. Santiago Casilla (1-0) pitched a perfect eighth for the win.

"You got to feel good after the team wins," said Lincecum. "Especially coming back from the hole I put them in there in that second inning."

Dexter Fowler and Josh Rutledge each drove in a pair of runs while Troy Tulowitzki hit a solo homer for the Rockies, who had won five straight coming into the series.

"They won a championship playing like that," said Colorado manager Walt Weiss. "They string together a lot of good at-bats."

Juan Nicasio pitched five-plus innings and was charged with four runs on five hits along with five walks and two strikeouts. Matt Belisle (0-1) gave up two runs on three hits over 1 2/3 innings to take the loss.

Trailing by four runs, San Francisco rallied in the sixth to tie the game.

The first two batters of the inning walked to chase Nicasio from the game. Adam Ottavino took the mound and a wild pitch moved the runners up before Crawford launched a pitch over the left field wall. Nick Noonan and Pagan singled before a sac bunt from Marco Scutaro moved the runners up a base.

After Pablo Sandoval was issued an intentional walk, Belisle came on the mound to face Pence, who greeted him with a single to score Noonan and make it a 6-6 game. Brandon Belt then hit into a double play to end the inning.

Jose Mijares stranded a man on second in the top of the seventh, but the Giants were set down in order in the bottom of the frame.

Casilla then worked a 1-2-3 eighth and the Giants went ahead in the bottom of the frame.

Andres Torres led off with a pinch-hit double and quickly came home when Pagan hit a single back up the middle. Run-scoring hits from Sandoval and Gregor Blanco made it a 9-6 game.

Sergio Romo set the Rockies down in order in the ninth for his fifth save of the season.

The Giants went on top in the first inning when Pence singled home Pagan, but the Rockies plated five runners in the second.

Tulowitzki walked to start the frame and moved to third as Michael Cuddyer reached base on a bad throw by Scutaro. Todd Helton then grounded out to score Tulowitzki.

Willin Rosario then walked and, after Chris Nelson struck out, Nicasio walked to load the bases. Fowler followed with a two-run double and Rutledge hit a two-run single for a 5-1 lead.

Scutaro atoned for the error with an RBI single in the second to get a run back for the Giants.

Tulowitzki, though, hit a blast over the wall in left in the fifth inning for a 6-2 advantage.

Game Notes

The Giants totaled 14 hits in the game while Colorado managed just four ... San Francisco went 7-for-17 with runners in scoring position ... The Giants have won eight straight over the Rockies ... Jeff Francis will be on the mound to help the Rockies avoid the sweep, while Barry Zito will pitch for the Giants in Wednesday's finale.