ST. LOUIS — Kolten Wong's guessing game worked to his advantage Tuesday night.
Wong drilled a two-out homer in the ninth inning to give the St. Louis Cardinals a 5-4 victory over the Pittsburgh Pirates before a capacity crowd of 43,162 at Busch Stadium.
Wong connected on a 3-2 fastball from recently acquired Ernesto Frieri (1-1) for his third homer of the season, a 420-foot drive that carried deep into the right-field stands.
"It was just crazy," Wong said of his first walk-off homer since he helped Hawaii beat Louisiana Tech with a 10th-inning shot on May 26, 2010. "Once I got to 3-2, I was sitting dead-red fastball. I was either going to get that pitch or strike out, because I was swinging at something hard. If he would have thrown something else, I probably would have been in trouble."
Wong also contributed a two-run double in the second as he jumped his average to .238. The home run was his third of the season.
"As soon as I hit it, I knew I hit it good," Wong said. "Looking at the trajectory of the ball, I knew it was going out. This is a big ballpark, and you've really got to hit it to get it out."
Matt Adams' ninth-inning homer Monday lifted the Cardinals to a 2-0 victory. The consecutive back-to-back walk-off wins for the Cardinals were their first since June 4-5, 2011, when Albert Pujols beat the Chicago Cubs on both occasions.
"That's kind of how it works, isn't it?" Cardinals manager Mike Matheny said. "What a great way to end the game again."
St. Louis has won nine of its last 11 home games against Pittsburgh, with four coming on walk-offs.
Trevor Rosenthal (1-4) pitched a scoreless ninth for the win, escaping a two-on, one-out jam by getting Gregory Polanco on a fly to center and striking out Starling Marte with a 98-mph fastball.
The Cardinals (49-42) moved 1/2-game ahead of third-place Cincinnati and 1 1/2 games ahead of fourth-place Pittsburgh in a tightly packed NL Central race that could go deep into September. St. Louis trails first-place Milwaukee by three games.
It's been a difficult season for Wong, the rookie second baseman who was optioned to Class AAA Memphis in May, then went on the disabled list in June with a bruised shoulder.
Wong finally could be settling in and playing with confidence.
"We've seen Kolten through some really good stretches," Matheny said. "It looks like he's gotten himself to the point where he feels good physically and is able to get through the ball. He had a couple of hard-hit balls today. What a game."
Carlos Martinez allowed four runs (earned) on eight hits in six innings, with two walks and six strikeouts. Randy Choate, Seth Maness, Pat Neshek and Rosenthal combined for three innings of scoreless relief.
Matt Holliday had a two-run double against Vance Worley in the fifth to tie the game at 4. With one out, Matt Carpenter and Jon Jay singled before Holliday lined his double into the left-center gap.
The Pirates took a 4-2 lead in the fifth on Andrew McCutchen's two-run homer against Martinez. Polanco singled to lead off. After Marte struck out, McCutchen hit his 14th homer into the Cardinals' bullpen in right.
The next batter, Neil Walker, tripled to left-center. But Walker was erased when he was picked off by catcher Yadier Molina.
Pittsburgh manager Clint Hurdle asked for a review of the play, and the call by umpire Alan Porter was upheld.
"That's a momentum-shifter," Matheny said. "To be able to shut that down ... That was a beautiful play."
Pedro Alvarez cracked a two-run homer against Martinez in the fourth as Pittsburgh tied the game at 2.
With one out, Ike Davis walked. Alvarez hit an 0-2 pitch into the bleachers in right-center, a 412-foot shot. Alvarez has more home runs (12) against the Cardinals than any other player since 2011.
St. Louis took a 2-0 lead in the second against Worley, who permitted four runs (earned) on nine hits in five innings.
With two outs, Jhonny Peralta and Oscar Taveras singled. Wong then rifled a two-run double into the right-center gap.