ST. LOUIS -- Before James McDonald headed to the mound for the bottom of the first inning, A.J. Burnett offered his beleaguered teammate two words of advice.
"I was talking to myself: `Why not?"' the Pittsburgh Pirates pitcher said after halting a string of ineffective starts with six innings of two-hit ball in a 2-1 victory over the St. Louis Cardinals on Friday night. "Just go out and play instead of making it something much more difficult than what it is."
|More on Pirates-Cardinals|
|More MLB coverage|
Andrew McCutchen singled and scored on a passed ball in a two-run fourth for the Pirates, who took the opener of a weekend series between NL Central playoff contenders. Pittsburgh scored its other run on a wild pitch that inning.
McDonald (11-5) was 0-2 in his previous four outings while allowing 20 earned runs over 21 1/3 innings. He coughed up a 7-1 lead in his last start when he allowed six runs in the fifth during a loss to the Padres.
"That was me. That's baseball," he said. "You see people go through ruts like that. What makes you a better player is getting through it. That's how I'll remember this time."
Pirates manager Clint Hurdle pulled the right-hander after 87 pitches to make sure the outing ended on a positive note.
"That's what we need from him," Hurdle said. "Not always zero runs and two hits. We need that focus, we need that commitment."
The Pirates expect this one to be a confidence-builder, both for McDonald and their postseason chances.
"This was a huge step forward for us," Hurdle said. "We're going to need him to get something done this year, I think."
Jake Westbrook (12-9) allowed one earned run and six hits in 7 2/3 innings for the Cardinals, who managed only one run for the second straight game. One inning was the difference on Thursday night, too, when closer Jason Motte gave up consecutive homers with one out in the ninth of a 2-1 loss to Arizona.
"I felt like I controlled the damage with just two runs scored," Westbrook said. "I put myself in that situation. It's nobody's fault but my own. I just got outpitched."
The Cardinals lead the National League in hitting but have 10 hits in the last two games, including four infield hits Thursday.
"Bottom line is there are no excuses," leadoff man Jon Jay said after going 0 for 3 with a walk. "We'll turn the page. Tomorrow is a big game."
McDonald retired the first 10 in order with the help of a double-play ball. Allen Craig doubled with two outs in the fourth for the Cardinals' first hit, but was erased trying to advance on a pitch McDonald bounced in front of the plate.
Joel Hanrahan worked around a one-out walk in the ninth for his NL-leading 34th save in 37 chances. Matt Holliday, just 4 for 45 in his last nine games, lined out to the right-field wall to start the inning.
The Pirates have won just three of nine, but they moved two games ahead of St. Louis for the NL's second wild-card spot. Pittsburgh won without second baseman Neil Walker, expected to miss the series after dislocating his right pinkie Wednesday.
Pittsburgh loaded the bases with a walk and singles by McCutchen and Garrett Jones to open the fourth, took the lead on Westbrook's wild pitch and made it 2-0 on a passed ball by Tony Cruz.
Westbrook said the wild pitch was a "terrible sinker that landed about 55 feet away." The passed ball came on a changeup.
"Actually, it was a really good changeup," Westbrook said. "It was a tough pitch to handle."
The Cardinals ended a string of 10 straight scoreless innings against Chris Resop in the seventh. Carlos Beltran opened with a bloop hit that ended a 2-for-20 slump and went to third on David Freese's double. Beltran scored on a one-out groundout by Cruz.
Cardinals third base coach Jose Oquendo was ejected by plate umpire Lance Barnett for arguing balls and strikes in the sixth.
St. Louis manager Mike Matheny said Barnett's strike zone was "significantly higher than we've had this season."
"He establishes the zone but that doesn't mean we have to like it," Matheny added.
Kyle Lohse worked 6 2-3 scoreless innings with no decision Thursday for St. Louis, his eighth of the year out of 19 quality starts. It's the most by a Cardinals pitcher since it happened nine times to Bob Tewksbury in 1992. ... Lance Lynn (13-5, 3.65 ERA) opposes Pirates LHP Erik Bedard (7-12, 4.56) on Saturday. Lynn has allowed three first-inning runs in three of his last four outings. ... The Cardinals released Triple-A Memphis 1B Mark Hamilton prior to the game in a move to clear space on the 40-man roster for lefty Jaime Garcia, due to pitch Sunday for the first time since June 5 when he was sidelined by shoulder fatigue. ... McCutchen leads the NL with a .360 average and 361 total bases. He scored his 85th run after entering the game tied for the league lead. ... Pittsburgh totaled 41 runs during its first six games in St. Louis this season.