ST. LOUIS — Barry Zito pitched the San Francisco Giants back into the NL championship series, dominating into the eighth inning of a 5-0 victory over the St. Louis Cardinals on Friday night that narrowed their deficit to 3-2.

The defending champion Cardinals might have thrown away a chance to clinch a second straight World Series trip. Pitcher Lance Lynn's toss on a possible forceout deflected off the second-base bag, paving the way for the Giants' four-run fourth.

Pablo Sandoval homered for the second straight night and Zito made an extremely rare offensive contribution with a perfectly executed bunt for an RBI single.

The Giants' win in Game 5 sent the series back to San Francisco. Game 6 will begin Sunday in the twilight at AT&T Park, with Ryan Vogelsong pitching against the Cardinals' Chris Carpenter.

Once again this postseason, the Giants benefited from a big error.

Needing three straight wins at Cincinnati to avoid elimination in the division series, San Francisco began its comeback on a bobble by third baseman Scott Rolen in the 10th inning that gave the Giants the go-ahead run in Game 3.

The Giants improved to 4-2 on the road this postseason and have won Zito's last 13 starts, with the last setback on Aug. 2. They're averaging more than six runs a game during the streak, although the lefty didn't need much help in this one.

Zito looked like the same guy who won the 2002 AL Cy Young award. He retired 11 batters in a row in one stretch while scattering six hits with six strikeouts in 7 2-3 innings.

Giants catcher Buster Posey twice tapped Zito on the chest when he was pulled in the eighth inning. It was Zito's first postseason win since 2006, shortly before he left the A's and signed a $126 million, seven-year contract with San Francisco.

Zito was left off the postseason roster when the Giants won the 2010 World Series because he had pitched so ineffectively. He started Game 4 of the division series against the Reds earlier in this year's playoffs and lasted only 2 2-3 innings.

Lynn, an 18-game winner his first year in the rotation, failed to make it out of the fourth for the second time in the series.

The Cardinals are seeking consecutive pennants for the first time since 1967-68, and trying to advance for the second year in a row as a wild-card entry. One more win would set up a rematch of the 2006 World Series against the Tigers, which the Cardinals took in five games.

Lynn struck out five of the first 10 batters, sailing through the first three innings with no balls hit out of the infield. His undoing was a wild throw off the second-base bag attempting to get a forceout on a comebacker that paved the way for San Francisco's four-run fourth.

The Giants had runners on first and second with one out when Lynn gloved a tapper by Hunter Pence, wheeled and waited a bit while rookie shortstop Pete Kozma hustled to second. But Lynn threw a low dart off the bag with the ball bounding into shallow right field and Marco Scutaro scoring without a play from second.

Eighth-place hitter Brandon Crawford singled up the middle with the bases loaded on a full count with two outs as Lynn just missed with a kick save for two more runs. Zito, who has just 30 career hits in 310 at-bats in the regular season with no extra-base hits and nine RBIs, laid down a perfect bunt for a fourth run.

Lynn has allowed four runs both of his NLCS starts, although all four were unearned in Game 5.

Zito's only trouble came in the second when Yadier Molina and David Freese, both swinging on the first pitch, opened the inning with a single and double. Lynn, a career .056 hitter including the postseason, hit into a bases-loaded double play to end the threat.

Lynn was 3 for 50 with 1 RBI, 10 sacrifices and 36 strikeouts during the regular season, going hitless his last 42 at-bats.

NOTES: Standing room attendance for Game 5 was 47,075, a franchise best for league championship play, topping the previous best in Game 4 by 13. ... Actor Matthew Morrison sang the national anthem. ... Longtime Cardinals broadcaster Mike Shannon bounced a ceremonial first pitch from in front of the mound to Lou Brock, teammates on the last St. Louis team to go to consecutive World Series in 1967 and `68. ... Carlos Beltran has 10 career stolen bases in the postseason. ... Matt Carpenter, who subbed for Beltran in Games 3 and 4, is a career .529 hitter (9 for 17) against the Giants counting the postseason with a homer and four RBIs. ... Cardinals rookie RHP Trevor Rosenthal struck out four in two scoreless innings. He has fanned 11 in 6 2-3 scoreless innings in the postseason while allowing just one hit.

Loading Slideshow...
  • Sergio Romo,Buster Posey

    San Francisco Giants' Sergio Romo celebrates with catcher Buster Posey after Game 5 of baseball's National League championship series against the St. Louis Cardinals Friday, Oct. 19, 2012, in St. Louis. The Giants won 5-0 and trails in the series 3-2. (AP Photo/Jeff Roberson)

  • Sergio Romo, Buster Posey

    San Francisco Giants' Sergio Romo and catcher Buster Posey celebrate after Game 5 of baseball's National League championship series against the St. Louis Cardinals Friday, Oct. 19, 2012, in St. Louis. The Giants won 5-0 and trails in the series 3-2. (AP Photo/David J. Phillip)

  • Sergio Romo

    San Francisco Giants relief pitcher Sergio Romo reacts after the final out in Game 5 of baseball's National League championship series against the St. Louis Cardinals Friday, Oct. 19, 2012, in St. Louis. The Giants won 5-0 and trails in the series 3-2. (AP Photo/Jeff Roberson)

  • Edward Mujica

    St. Louis Cardinals relief pitcher Edward Mujica works during the ninth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Matt Holliday

    St. Louis Cardinals' Matt Holliday reacts after striking out to end the eighth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Patrick Semansky)

  • Buster Posey. Barry Zito

    San Francisco Giants catcher Buster Posey talks to starting pitcher Barry Zito before Zito left the game during the eighth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Santiago Casilla

    San Francisco Giants relief pitcher Santiago Casilla throws during the eighth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Barry Zito

    San Francisco Giants starting pitcher Barry Zito throws during the eighth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Pablo Sandoval, Mitchell Boggs

    St. Louis Cardinals relief pitcher Mitchell Boggs kicks the mound as San Francisco Giants' Pablo Sandoval rounds the bases after Sandoval hit a home run during the eighth inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Patrick Semansky)

  • Pablo Sandoval

    San Francisco Giants' Pablo Sandoval reacts as he crosses home after hitting a home run during the eighth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Patrick Semansky)

  • Pablo Sandoval

    San Francisco Giants' Pablo Sandoval reacts after hitting a home run during the eighth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Pablo Sandoval

    San Francisco Giants' Pablo Sandoval reacts after hitting a home run during the eighth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Pablo Sandoval

    San Francisco Giants' Pablo Sandoval rounds the bases after hitting a home run during the eighth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Pablo Sandoval

    San Francisco Giants' Pablo Sandoval hits a home run during the eighth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Pablo Sandoval

    San Francisco Giants' Pablo Sandoval hits a home run during the eighth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Mark Humphrey)

  • Allen Craig

    St. Louis Cardinals first baseman Allen Craig can't come up with a foul ball hit by San Francisco Giants' Pablo Sandoval during the eighth inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Mitchell Boggs

    St. Louis Cardinals relief pitcher Mitchell Boggs throws during the eighth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Hunter Pence

    San Francisco Giants right fielder Hunter Pence makes a diving catch on a ball hit by St. Louis Cardinals' Pete Kozma during the fifth inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • revor Rosenthal

    St. Louis Cardinals relief pitcher Trevor Rosenthal throws during the sixth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • San Francisco Giants third baseman Pablo Sandoval blows a bubble as he fields a ball hit by St. Louis Cardinals' Jon Jay during the fifth inning of Game 5 of baseball's National League championship series Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Patrick Semansky)

  • Hunter Pence

    San Francisco Giants right fielder Hunter Pence makes a diving catch on a ball hit by St. Louis Cardinals' Pete Kozma during the fifth inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Patrick Semansky)

  • Hunter Pence

    San Francisco Giants right fielder Hunter Pence makes a diving catch on a ball hit by St. Louis Cardinals' Pete Kozma during the fifth inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Hunter Pence

    San Francisco Giants right fielder Hunter Pence reacts after making a diving catch on a ball hit by St. Louis Cardinals' Pete Kozma during the fifth inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • San Francisco Giants right fielder Hunter Pence makes a diving catch on a ball hit by St. Louis Cardinals' Pete Kozma during the fifth inning of Game 5 of baseball's National League championship series Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Pete Kozma

    St. Louis Cardinals shortstop Pete Kozma can't come up with a ball hit by San Francisco Giants' Buster Posey during the fifth inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Yadier Molina

    St. Louis Cardinals' Yadier Molina loses his bat as he grounds out during the fourth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Yadier Molina

    St. Louis Cardinals' Yadier Molina loses his bat as he grounds out during the fourth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Mark Humphrey)

  • Lance Lynn

    St. Louis Cardinals starting pitcher Lance Lynn walks to the dugout after being taken out of the game in the fourth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Patrick Semansky)

  • Lance Lynn

    St. Louis Cardinals starting pitcher Lance Lynn reacts in the dugout after being taken out of the game in the fourth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Lance Lynn

    St. Louis Cardinals starting pitcher Lance Lynn reacts in the dugout after being taken out of the game in the fourth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Brandon Crawford

    San Francisco Giants' Brandon Crawford hits a two-run single during the fourth inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Mark Humphrey)

  • Yadier Molina ,Gregor Blanco

    St. Louis Cardinals catcher Yadier Molina watches the ball as San Francisco Giants' Gregor Blanco scores on a suicide squeeze by Barry Zito during the fourth inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. Zito was safe at first. (AP Photo/David J. Phillip)

  • Joe Kelly

    St. Louis Cardinals relief pitcher Joe Kelly works during the fourth inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Pablo Sandoval ,Pete Kozma

    San Francisco Giants' Pablo Sandoval runs into St. Louis Cardinals' Pete Kozma on a play where Kozma couldn't handle a throw during the fourth inning of Game 5 of baseball's National League championship series Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Pablo Sandoval ,Pete Kozma

    San Francisco Giants' Pablo Sandoval runs into St. Louis Cardinals' Pete Kozma on a play where Kozma couldn't handle a throw during the fourth inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Pete Kozma,Pablo Sandoval

    St. Louis Cardinals' Pete Kozma can't handle a throw from starting pitcher Lance Lynn as the ball hits the bag during the fourth inning of Game 5 of baseball's National League championship series Friday, Oct. 19, 2012, in St. Louis. San Francisco Giants' Pablo Sandoval (48) was safe at second. (AP Photo/David J. Phillip)

  • Lance Lynn

    St. Louis Cardinals' Lance Lynn breaks his bat as he hits into a double play during the second inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Gregor Blanco,Allen Craig

    San Francisco Giants' Gregor Blanco makes it back to first as St. Louis Cardinals first baseman Allen Craig takes a throw during the third inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Hunter Pence

    San Francisco Giants right fielder Hunter Pence can't come up with a double hit by St. Louis Cardinals' David Freese during the second inning of Game 5 of baseball's National League championship series, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Patrick Semansky)

  • Lance Lynn

    St. Louis Cardinals' Lance Lynn breaks his bat as he hits into a double play during the second inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Mark Humphrey)

  • Mike Matheny

    St. Louis Cardinals manager Mike Matheny reacts during the second inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Hunter Pence ,

    San Francisco Giants' Hunter Pence can't come up with a double hit by St. Louis Cardinals' David Frees during the second inning of Game 5 of baseball's National League championship series Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • David Freese

    St. Louis Cardinals' David Freese hits a double during the second inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Mark Humphrey)

  • Marco Scutaro ,Carlos Beltran

    San Francisco Giants' Marco Scutaro can't handle the throw as St. Louis Cardinals' Carlos Beltran steals third during the first inning of Game 5 of baseball's National League championship series Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Jeff Roberson)

  • Daniel Descalso

    St. Louis Cardinals' Daniel Descalso reacts after striking out during the second inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • Lance Lynn

    St. Louis Cardinals starting pitcher Lance Lynn throws during the first inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Elsa, Pool)

  • St. Louis Cardinals starting pitcher Lance Lynn throws during the first inning of Game 5 of baseball's National League championship series against the San Francisco Giants, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Elsa, Pool)

  • San Francisco Giants starting pitcher Barry Zito throws during the first inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Elsa, Pool)

  • San Francisco Giants starting pitcher Barry Zito throws during the first inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals, Friday, Oct. 19, 2012, in St. Louis. (AP Photo/Elsa, Pool)

  • San Francisco Giants' Pablo Sandoval reacts after fouling a ball off his foot during the first inning of Game 5 of baseball's National League championship series against the St. Louis Cardinals Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)

  • St. Louis Cardinals starting pitcher Lance Lynn sits on the bench after throwing during the first inning of Game 5 of baseball's National League championship series against the San Francisco Giants Friday, Oct. 19, 2012, in St. Louis. (AP Photo/David J. Phillip)