Matt Holliday hit the go-ahead home run off A.J. Burnett to lead off the sixth inning, his 24th of the season. It broke a 2-2 tie.
The Cardinals' Kyle Lohse (14-2) pitched five innings, gave up two runs and five hits with three strikeouts and no walks. He hasn't lost a start since mid-June.
Burnett (15-5) surrendered four runs (three earned) and seven hits and struck out three in 5 ⅔ innings.
Pittsburgh had a 2-0 lead heading into the fifth after an Andrew McCutchen RBI-single and a Josh Harrison sac fly in the fourth. St. Louis tied it in the fifth inning with a Skip Schumaker RBI double and an RBI single from Lohse.
St. Louis currently holds the second NL wild card spot, while the Pirates are three games back. Game 2 is set for Tuesday, with the first pitch at PNC Park scheduled for 7:05 p.m. ET.
Be sure to head over to Viva El Birdos for more Cardinals coverage, and check out Bucs Dugout for more on the Pirates. Also visit Baseball Nation for even more news and analysis from around the league.