Buster Posey drove in three runs and the San Francisco Giants took advantage of some clunky defense by St. Louis first baseman Matt Adams, beating the Cardinals 6-4 on Wednesday night to move within one victory of the World Series.

Chasing their third title in five years, the Giants lead the best-of-seven NL Championship Series 3-1 after poor throws cost the Cardinals yet again.

October ace Madison Bumgarner can pitch San Francisco to another pennant Thursday night at home in Game 5. Struggling All-Star Adam Wainwright starts for St. Louis, now facing the same daunting deficit the Giants overcame to beat the Cardinals in the 2012 NLCS.

Kansas City awaits the winner after completing its ALCS sweep of Baltimore earlier in the day. The wild-card Royals will host Game 1 of the World Series on Tuesday night.

San Francisco climbed out of an early three-run hole, and back-to-back bad throws by Adams in the sixth inning helped the Giants rally -- one night after a wild toss by St. Louis reliever Randy Choate allowed the winning run to score in the 10th inning.

The Cardinals were clinging to a 4-3 lead when San Francisco put runners at second and third. Playing in with one out, the lumbering Adams backhanded Gregor Blanco's bouncer and stumbled as he tried to set himself to throw home.

Adams had trouble with the transfer, and his toss short-hopped catcher Tony Cruz as Juan Perez slid across with the tying run.

Joe Panik then hit a grounder right to Adams, who stepped on first base before firing wildly to second in trying for a double play. Brandon Crawford stopped about halfway between third and home, yet was able to score easily when Adams threw wide of the bag.

Cardinals shortstop Jhonny Peralta came way off the base to catch the ball, but had no play at the plate.

Posey added an RBI single off Seth Maness to make it 6-4. The star catcher also had a sacrifice fly in the first and a run-scoring single in the third.

These Giants joke about not needing hits and home runs to win, and they're showing that with timely bunts, small ball and a few miscues from the opponent. The tying and go-ahead runs came home on balls that didn't leave the infield.

Yusmeiro Petit pitched three scoreless innings to win in relief of an ineffective Ryan Vogelsong. Petit has been a valuable long man -- he delivered six shutout innings in an 18-inning NLDS victory at Washington.

Sergio Romo worked the eighth and Santiago Casilla finished for his second save of the series.

A total of six Giants relievers held St. Louis scoreless over the final six innings.

Marco Gonzales took the loss after issuing a leadoff walk to pinch-hitter Perez in the sixth and giving up a single to Crawford.

The Giants haven't homered in six games since Brandon Belt connected in the 18th inning at Washington, but it hasn't mattered much.

Cardinals rookie Kolten Wong showed off more postseason power, but his solo homer was wasted.

Choate entered to loud cheers and pitched to chants of "Choate! Choate!" from the raucous, orange towel-twirling sellout crowd of 43,147. They were boosted late by Journey vocalist Steve Perry in the stands joining in on "When the Lights Go Down in the City."

When Choate retired Panik on a comebacker to end the fourth, the left-hander sprinted to within a few feet of first before tossing the ball underhanded to Adams.

The Cardinals grounded into three double plays that cost them chances to add on to their early 1-0 lead. They turned a couple gems of their own, too, before the blunders.

Vogelsong was the only pitcher in major league history to yield no more than one run in his first five postseason starts, but his streak ended when he gave up four in three innings. San Francisco has still won all six of the postseason games he has started.