ST. LOUIS -- Minutes after Saturday's game, a thunderstorm drenched Busch Stadium.
Matt Carpenter supplied the thunder and lightning to beat the rain and the Pittsburgh Pirates.
Belting the first walk-off home run of his big league career, the St. Louis Cardinals' third baseman drilled a two-run shot into his team's bullpen in right-center to give St. Louis a 6-4 verdict.
It was the fourth homer of the year for Carpenter, who picked on a 1-and-2 changeup from reliever A.J. Schugel (0-1), ripping it 402 feet for the Cardinals' second last-swing win in four days.
"It wasn't on the list," Carpenter said of the game-winner. "Cross it off."
It enabled St. Louis (16-15) to cross something else off its list --its first win of the year in five games with Pittsburgh (16-14).
The Cardinals overcame an early 2-0 deficit, then a throwing error on shortstop Aledmys Diaz that gave the Pirates a fourth out in the ninth.
Pittsburgh capitalized, Starling Marte lashing a game-tying ground-rule double to left-center against closer Trevor Rosenthal (1-0). But that was still tainted with a bitter aftertaste for the Pirates as the ball bounced over the wall, denying Gregory Polanco an easy go-ahead run.
"I don't think there's any doubt that he scores if that ball stays in the ballpark," Pittsburgh manager Clint Hurdle said. "That's the definition of a bad bounce."
Rosenthal retired Francisco Cervelli on a five-foot tapper in front of the plate that Yadier Molina collected, tagging Cervelli before he could leave the batter's box.
Diaz then made some amends for his first error in 12 games, legging out an infield hit to start the St. Louis ninth. After Jeremy Hazelbaker's bid for a walk-off homer was hauled in at the left-center field wall by Marte, Carpenter unloaded what he said was his first walkoff bomb since Double-A.
"Being able to win a game like that is awesome, especially with how the game played out," Carpenter said. "But that's baseball. You have your ups-and-downs. and it's an emotional roller-coaster sometimes."
It was the latest in a series of close games between the Cardinals and Pirates, usually won by the home team. This one took a series of twists and turns, leaning early towards offense and then becoming a pitchers' duel in the middle innings.
Each team picked up two runs in the first. Pittsburgh's first four hitters collected hits off Adam Wainwright, with Gregory Polanco's bloop single to left-center scoring John Jason and Jung Ho Kang's sacrifice fly to right plating Andrew McCutchen.
St. Louis tied it in its half of the first on a two-run single by Randal Grichuk, then grabbed a 3-2 lead in the third when Stephen Piscotty led off with a homer to right-center that bounced off the top of the wall and nestled into the seats.
Wainwright appeared fully capable of making that lead hold up to the end. In a performance that looked more like the dominant workhorse he was during 2013-14 and not the guy who compiled a 6.68 earned run average in his first six starts, Wainwright retired 14 straight after Jordy Mercer's single in the second.
"The fastball was at 92 (mph) and the curve was at 75," Hurdle said of Wainwright. "That's 17 miles per hour you're playing with and that's a big gap."
But the Pirates finally got Wainwright out with one out in the seventh and tied it an out later when Jaso grounded a two-out single to left-center off reliever Seung Hwan Oh, scoring pinch-hitter Matt Joyce.
Wainwright went 6 1/3 innings, yielding seven hits and three runs with no walks and five strikeouts.
Pittsburgh's Jeff Locke retired the last 12 men he faced after permitting Piscotty's homer, going six innings and giving up four hits along with three runs. Locke walked two and fanned one.
The Cardinals grabbed a 4-3 lead in the eighth on Grichuk's two-out RBI single, setting the stage for a wild ninth inning as the skies darkened and the wind picked up.
Carpenter kept everyone from enduring a long rain delay.
"I thought it had a good chance, but you never know with the weather coming in," he said of the homer. "I wasn't sure if the wind had shifted."
NOTES: St. Louis 1B Matt Adams (left knee/quad) was back in the lineup Saturday after sitting out Friday night's game. Adams was injured in Thursday's game with Philadelphia, leaving after four innings. ... Pittsburgh 3B Jung Ho Kang's two-homer game Friday night was the second of his career. Four of his 17 career homers have occurred against Cardinals pitching. ... St. Louis pinch-hitters are batting .382 with an MLB-best 21 hits, seven homers and 14 RBIs. By contrast, the Atlanta Braves entered Saturday with just six homers as a team.