ST. LOUIS -- The last time Adam Wainwright gave up three homers in a game was four years ago. So was the last time he knocked in three runs in a game.

Tuesday night, he did both, and his bat helped make up for the Pittsburgh Pirates' long-ball production as the St. Louis Cardinals expanded their National League Central lead with a 6-4 win at Busch Stadium.

Wainwright (16-9) worked into the seventh inning, leaving after a two-run homer by left fielder Starling Marte cut the Cardinals' lead to 5-4. He also allowed solo blasts to catcher Russell Martin in the second and shortstop Jordy Mercer in the third.

However, Wainwright won for just the third time in seven decisions, giving up seven hits and all four runs with a walk and three strikeouts. One big reason was the work he did with his bat.

After grounding out to Mercer to bring home St. Louis' first run in the second, Wainwright knocked out Jeff Locke (6-4) with a two-run single in the fourth, capping a three-run rally that snapped a 2-2 tie.

"There are two or three games a year that can swing your way if you can help yourself," Wainwright said. "The first run, I hit the ball just fat enough and got it to the shortstop. The hit, Locke made a real good pitch but I just stayed through the ball."

Wainwright entered the night hitting .196 with three RBIs in 56 at-bats. By doubling his season total, he also allowed the Cardinals (75-63) to double their division lead.

Second place Milwaukee lost its seventh straight game, a 7-1 decision at the Chicago Cubs, and now trails St. Louis by two. The Cardinals' fourth straight win dropped the Pirates (71-67) four games off the pace.

However, Mercer quickly shot down the notion that Wednesday's series finale is a must-win game for Pittsburgh.

"Every game is big," he said. "We still have a lot of time to go. We all know that anything can happen."

St. Louis has scored 33 runs in its recent winning streak, although it didn't exactly knock down the walls in this one. Outhit 8-7, the Cardinals made up for it by using Locke's wildness to their advantage.

The left-hander shackled St. Louis Wednesday, earning a 3-1 win in a game that saw him cruise through 7 1/3 innings. But he simply couldn't find the strike zone with any consistency in the rematch, throwing just 46 of 86 pitches for strikes and walking five.

Locke gave up four hits and was charged with five runs, four earned. He struck out three as his four-game winning streak ended.

"He was pounding the inner half last week," said Cardinals center fielder Peter Bourjos, whose RBI single in the fourth put his team ahead for good. "I don't think he had his best command tonight. He was behind in a lot of counts."

More wildness gave St. Louis an insurance run in the seventh. A wild pitch by reliever John Axford scored shortstop Jhonny Peralta, who led off with a double and moved to third on a groundout.

The Cardinals bullpen closed things down with three scoreless innings, Pat Neshek throwing a clean ninth for his fifth save.

Manager Mike Matheny was cheered by parts of Wainwright's performance, saying the team's veteran ace is close to regaining the form that made him the NL's All-Star Game starter.

"There were signs of a better breaking ball," Matheny said. "He looked like he was more on time with his delivery. For us to able to come out there and win without him at his best, it's a good night."

NOTES: St. Louis announced that RHP Michael Wacha (stress reaction in shoulder) will be recalled from his rehab assignment and start Thursday night's series opener in Milwaukee. Wacha, who pitched two innings Sunday night for Double-A Springfield, will be on a pitch limit of 50 to 60. ... Pittsburgh called up six players from Triple-A Indianapolis, including its Tuesday night starter, LHP Jeff Locke, and OF Gregory Polanco. Also coming up to the Pirates are RHPs Casey Sadler and John Holdzkom, LHP Bobby LaFromboise and INF/OF Chase d'Arnaud. ... The Cardinals called up LHPs Marco Gonzales, Tyler Lyons and Nick Greenwood from Springfield, as well as C Tony Cruz. They activated RHP Jason Motte (lower back) from the 15-day DL.