ST. LOUIS -- To earn his 16th win, Adam Wainwright really needed his bat.
"There's usually two or three games a year that you swing the outcome if you can provide something offensively," Wainwright said. "I just made a couple of good swings."
The bottom of the order was the difference in the fourth win in a row for the NL Central leaders. Eighth-place hitter Peter Bourjos singled twice with an RBI, and seventh-place hitter Daniel Descalso walked twice and scored twice.
"I feel like we're really ready to take off," Bourjos said. "We're getting contributions from everybody."
Wainwright (16-9) prevailed despite allowing three home runs to match his career worst. He left after Starling Marte's two-run shot shaved the lead to 5-4 with none out in the seventh. It was the first time he had allowed more than one homer all season.
He has been getting by with less than his best stuff for a while, and like most of his recent starts, he believes he is close.
"You can look at the three balls in the middle of the plate that got hit out, but I think most of the time I was much better than I have been," Wainwright said.
"That's what we see too," manager Mike Matheny said. "I think he's off just a hair sometimes."
Russell Martin and Jordy Mercer homered with the bases empty for the Pirates, who have lost three in a row and were frustrated to get beaten by Wainwright's bat. He doubled his season RBI total and is batting .203 overall.
"We treat him like a hitter," Martin said. "He gave some up but he took some back and that's just the type of competitor he is.
"He was one of the toughest outs."
Despite the damage, Wainwright didn't face any batters with runners in scoring position. He lost his previous two outings, the last at Pittsburgh when he allowed three runs in six innings.
Wainwright had thrown 28 1/3 consecutive scoreless innings at home against Pittsburgh before Martin homered in the second.
The first four Cardinals reached base in a three-run fourth that snapped a 2-all tie. Wainwright's two-run single chased Jeff Locke (6-4), who walked five and was charged with five runs -- four earned. Wainwright also had a run-scoring groundout in the second and matched a three-RBI game he had against the Brewers on July 4, 2010, in which he also threw a complete game in a 7-1 win.
Locke allowed a run in 7 1/3 innings with two walks against the Cardinals his last time out. He worked around a season-worst six walks to win at Milwaukee on Aug. 22 and was 4-0 with a 2.90 ERA in five August starts.
"I just didn't have any command, fell behind everybody," Locke said. "They were really in the driver's seat the whole time."
Jhonny Peralta doubled to start the seventh and scored on a wild pitch by John Axford that put St. Louis up 6-4. Trevor Rosenthal got a day off, and Pat Neshek finished for his fifth save in eight chances.
Cardinals: Kolten Wong didn't start for the second straight game after banging his head making a catch. He pinch hit in both games, and his homer tied it on Monday.
Pirates: Edinson Volquez (11-7, 3.45) has won seven of his last eight decisions. He is 4-6 with a 5.06 ERA in 14 career starts against the Cardinals.
Cardinals: St. Louis seeks a sweep behind Shelby Miller (8-9, 4.19). The right-hander is 2-6 with a 4.98 ERA against Pittsburgh, including 2-2 this year.
Cardinals 3B coach Jose Oquendo was ejected at the end of the third inning, apparently for arguing balls and strikes with home plate umpire James Hoye.
Seattle Mariners decline $14M club option on Dee Strange-Gordon
The Mariners declined their $14 million club option on infielder Dee Strange-Gordon for the 2021 season on Wednesday, making the veteran eligible for free agency.
Arizona Diamondbacks decline 2021 options for Mike Leake, Hector Rondon, Junior Guerra
The Arizona Diamondbacks have declined options for the 2021 season for right-handed pitchers Mike Leake, Hector Rondon and Junior Guerra.
Los Angeles Dodgers-Tampa Bay Rays World Series TV ratings average drops 32% below previous low
The Dodgers' six-game Series win over the Rays averaged a 5.2 rating, 12 share and 9,785,000 viewers, Nielsen Media Research said. The previous low was a 7.6 rating, 12 share and 12,660,000 viewers for the Giants' four-game sweep of the Tigers in 2012.
Snell's gem cut short by Kevin Cash in the sixth inning
Blake Snell pitches a gem for the Rays in Game 6, allowing just two hits and striking out nine in 5⅓ innings, but he is pulled by manager Kevin Cash after allowing a hit in the sixth inning.
St. Louis Cardinals not picking up 2021 option on Kolten Wong
St. Louis declined Kolten Wong's $12.5 million option for 2021, making the longtime Cardinals second baseman a free agent. The Cardinals will pay Wong a $1 million buyout.
Colorado Rockies opt for $6 million buyout to Daniel Murphy
Colorado won't pick up the $12 million option on Daniel Murphy and will instead pay a $6 million buyout to the infielder who failed to flourish in his two years with the Rockies.