With the Pirates playing their first nationally televised Sunday night game from PNC Park in the facility's 13-year history, everything was set up for Pittsburgh to win once again in dramatic fashion.
The Pirates scored one run in the ninth inning on Andrew McCutchen's single to make it a one-run game and had the bases loaded with no one out. Already the major league leaders with five walkoff victories, Pittsburgh seemed on the verge of another.
However, St. Louis closer Trevor Rosenthal escaped the jam for his 10th save and Shelby Miller won his fourth straight start as the Cardinals held on for a 6-5 victory.
Rosenthal got Ike Davis to foul out for the first out then induced Jordy Mercer to hit into a 1-2-3 double play to end it as the Pirates' season-high four-game winning streak was snapped.
"You come up there, you've got Davis and Mercer, two guys who are swinging the bat well, have gotten to a good place," Pittsburgh manager Clint Hurdle said. "We weren't able to cash in."
Mercer hit his first home run of the season, a two-run shot in the fourth inning earlier in the game, but couldn't play the hero as hit a low fastball back to Rosenthal.
"That wasn't my pitch to swing at," Mercer said. "I think I got a little overaggressive right there."
The Cardinals were able to salvage one game in the three-game series and avoid their first three-game losing streak of the season.
"That felt like a walk-off win right there," Cardinals manager Mike Matheny said with a relieved smile. "That was beyond impressive what Trevor was able to do there at the end to get it back together. That's why he is pitching at the end of games."
Charlie Morton (0-5) gave up four runs in six innings, all in the first inning and only one earned, but remained winless since Sept. 2, a span of 14 starts. He also fell to 2-10 in his career against the Cardinals.
"I just tried to get back out there and put up zeroes after that first inning," Morton said. "We kept chipping away and we almost pulled it out but I can't give up four runs there, especially in the first inning. It put us in a bad spot from the start."
Pittsburgh's Pedro Alvarez had three hits and Tony Sanchez added two.
St. Louis' Allen Craig and Yadier Molina had two hits each, including RBI singles in the four-run first. Craig went 5-for-11 in the three-game series after entering with a .202 batting average. Molina was 0-for-12 in his previous four games.
Miller (5-2) walked four and allowed four hits in 5 1-3 innings, but held the Pirates to just two runs — which came on Mercer's home run in the fourth inning.
"I didn't have much but I gave it what I got and fortunately it was enough to help us get a win," Miller said.
Jon Jay also had two hits for St. Louis. Mark Ellis added an RBI single in the first inning for St. Louis and Craig hit a sacrifice fly.
Notes: McCutchen returned to the lineup after missing Saturday's game with soreness in his left ankle. ... Pittsburgh LF Starling Marte was not in the lineup because of lower back tightness, which caused him to leave Saturday night's game in the fourth inning. ... Pirates RF Travis Snider batted leadoff after missing the previous two games while serving a suspension from Major League Baseball for his actions April 20 in a benches-clearing brawl with the Milwaukee Brewers. ... Bourjos, who started the previous four games, did not start because of a cut on his right wrist that came as a result of getting spiked Saturday night while attempting to break up a double play. However, he entered the game in the game in the seventh inning as a defensive replacement. ... The Cardinals host the Chicago Cubs on Monday night in the opener of a four-game series with LHP Tyler Lyons (0-2, 3.45) facing LHP Travis Wood (2-4, 4.75). ... The Pirates are off Monday then begin a three-game series Tuesday night at Milwaukee.