SAN FRANCISCO (AP) -- One bad inning ended up ruining Tim Lincecum's start. Brandon Crawford and the rest of the San Francisco hitters made sure it wasn't a wasted night for the Giants.
Crawford started San Francisco's rally from a four-run deficit that Lincecum created by hitting a three-run homer and Angel Pagan added a tiebreaking single in the eighth inning to lead the Giants to their eighth straight win over the Colorado Rockies, 9-6 on Tuesday night.
''You have to feel good after the team wins, especially coming back from the hole I put them in there in the second inning,'' Lincecum said. ''I feel good about that. But I'm going back to the chalkboard after every start and going into refining mode and trying to fix the errors. That second inning really was a doozy for me.''
Lincecum walked three batters, including the pitcher, and threw a wild pitch that helped lead to a five-run inning for Colorado. But he settled down after that, staying in the game for four more innings, and then watched his teammates rally for the win.
Hunter Pence had a pair of RBI singles and Pagan and Marco Scutaro each had three hits for the Giants, who have won the first two games of the series.
Dexter Fowler and Josh Rutledge each drove in two runs in the second inning, and Troy Tulowitzki added a solo homer off Lincecum to help the Rockies build a 6-2 lead.
But the Giants scored four runs in the sixth to tie the game and then won it in the eighth against Matt Belisle (0-1).
''The Giants just keep coming,'' Rockies manager Walt Weiss said. ''They won a championship playing like that. They string together a lot of good at-bats, there are a lot of tough outs over there. We couldn't shut them down.''
Pinch-hitter Andres Torres started the winning rally with a double to right field and Pagan followed with a single up the middle that almost hit Belisle in the face.
Pablo Sandoval and Gregor Blanco added RBI singles to give the Giants insurance.
Santiago Casilla (1-0) pitched a perfect eighth for the win and Sergio Romo got three outs for his fifth save.
The Rockies appeared to be in control until Juan Nicasio walked the first two batters of the sixth to end his night after 95 pitches, marking the 110th straight game a Rockies starter has failed to reach the 100-pitch mark.
Adam Ottavino came in and allowed Crawford's second career homer at AT&T Park, a rare opposite-field shot in a noted pitchers' park.
''I fell behind 2-0, we had a four-run lead, so I tried to challenge him,'' Ottavino said. ''I wasn't trying to be too fine. He put a good swing on it. I've had success against him in the past, especially away. When he hit it I was going to back up third. It surprised me when it went out.''
The Giants then loaded the bases with one out before Belisle relieved and allowed a tying single by Pence that gave him 1,000 career hits. Belisle escaped the jam without further damage when he got Brandon Belt to hit into an inning-ending double play.
Lincecum, a two-time NL Cy Young Award winner, is still trying to find his groove following a disappointing 2012 season when he had a career-high 15 losses and an NL-worst 5.18 ERA.
After matching a career high with seven walks in his first start last week against the Los Angeles Dodgers, Lincecum was hurt again by a lack of command against the Rockies.
He might have escaped the second unscathed if not for a bad decision by Scutaro, who threw wildly trying to get a force at second base instead of taking a sure out at first. That helped set up the big inning that featured a two-run double by Fowler and a two-run single by Rutledge.
Lincecum retired nine of 10 batters following Rutledge's single, allowing only another walk to Nicasio. But Tulowitzki added to the Rockies' lead when he sent a first pitch halfway up the seats in left field for his third homer of the season.
Lincecum allowed six runs, four hits and four walks with seven strikeouts in six innings.
''He had great stuff. Unfortunately all the innings count,'' manager Bruce Bochy said. ''He had trouble getting out of that second inning. Really other than that he threw the ball very well. I thought he threw the ball great and didn't let the game get out of control and kept us from going to the 'pen early and gave us a chance to make that comeback.''
NOTES: Colorado has homered in all eight games. ... With a day game Wednesday, Bochy gave reigning NL MVP Buster Posey the night off and started Hector Sanchez at catcher. Bochy said Sanchez could end up being Lincecum's regular catcher but he doesn't want to commit to that yet. ... Barry Zito, who is 7-2 in his career vs. Colorado, will start the series finale against Jeff Francis.