Urgency evolved out of frustration for being outperformed by the Pirates on back-to-back days. The Cardinals had been outscored, 21-10, in the first two games, which left them 2 1/2 games behind second-place Pittsburgh in the division race.
On Sunday, St. Louis raced out to a three-run lead, endured a counter punch from the Pirates during their four-run fourth, but then answered back in the fifth.
Pirates starter Erik Bedard hit Matt Carpenter to lead off the inning and then served up a game-tying double to Matt Holliday, who is now batting .491 since June 16. After collecting two outs, Bedard chose a matchup with fill-in outfielder Shane Robinson over one with Yadier Molina, who had already homered in the game.
Bedard intentionally walked the Cardinals' All-Star catcher.
At first expecting to see Pirates manager Clint Hurdle summon a right-handed reliever to face him, Robinson, seeing no such movement, quickly shifted his focus to Bedard. His scouting report was self-derived.
"Based on my previous two at-bats, I knew he was going to keep throwing that cutter, trying to pound me in with it," said Robinson, making his first start since June 24. "I was kind of more aware of it."
Robinson saw what he was looking for on the second pitch of the at-bat and lined the fastball into center field to drive home the go-ahead -- and eventual, winning -- run.
"They were targeting Shane right there, and he answered," Matheny said. "It was a huge lift, obviously."
Cardinals starter Jake Westbrook (7-6) and a string of relievers held the lead from there. Westbrook had earlier allowed four runs in a five-batter span, but he kept the Pirates hitless in their seven other chances with runners in scoring position.
The sixth inning, a key one for Westbrook, was the first of three consecutive innings in which Cardinals pitchers stranded at least one Pittsburgh baserunner in scoring position.
With a one-run lead to protect, Westbrook allowed two of the first three sixth-inning batters to reach -- one via a walk, the other an infield hit. Matheny made his way out of the dugout.
Before he could get to the mound, however, Molina was already talking with Westbrook, using the conversation as reassurance that the right-hander still felt as good as he looked. Matheny needed to know no more. His mound visit was brief, and he returned to the dugout, where he watched Westbrook wrap up the inning.
"It pumped me up, just the fact that Yadi was so confident in me to stay out there," Westbrook said. "I was going to plead my case, too, though Yadi was doing it before I even got to. It was good to see him have confidence in me."
Westbrook, whose biggest mistake was a flat fastball that Pirates catcher Michael McKenry drove into the seats for a three-run homer, has now won three straight decisions. The streak follows a string of six consecutive outings without a victory.
He was staked to an early three-run lead with homers from Molina and Allen Craig, whose two-run blast increased his RBI total to 39 in as many games played this year.
The Cardinals' offense, though, went quiet late, leaving the bullpen with the task of preserving a one-run lead.
Marc Rzepczynski, who had allowed three runs to this Pirates club on Friday, would have finished a scoreless seventh had it not been for an error by Robinson, who dropped a routine fly ball. As it was, Mitchell Boggs recorded the final out of the frame.
Boggs returned in the eighth, which, too, turned tricky. Consecutive singles and a sacrifice bunt left Boggs to deal with a pair of runners in scoring position with one out. McKenry, who had already changed the game once, was up with another RBI chance.
"He's a guy that's been swinging the bat pretty hot in this series," Boggs said. "For me it was just to make aggressive pitches. I knew he wasn't going to hold anything back. I just wanted to sink the ball in on him, keep the ball down, try to make a pitch right there to keep the runner at third."
Boggs induced an infield popup. Closer Jason Motte, brought in for a four-out save, finished the bailout by getting a flyout. With a 1-2-3 ninth, Motte was credited with his 17th save in 21 chances.
"They used a lot of different bullpen guys the last two days, and used the three best guys to go for 7-8-9, and they're as tough as anybody in the league," McKenry said. "That's a special group."