The victory moved the Cardinals into first place, a half-game ahead of the Pirates in the NL Central. Pittsburgh has lost four of six including the first two of the three-game set. The Pirates remain stuck on 81 wins, one shy of assuring them a winning record for the first time since they went 96-66 in 1992.
Wainwright (16-9) had given up 15 earned runs over his previous two starts, both against Cincinnati. He allowed a career-high nine runs in two innings of a 10-0 loss Aug. 28. But he regained his form against the Pirates allowing just two hits. He struck out eight and walked two.
"The way to make pitching as simple as possible is to repeat your delivery and execute your pitches," he said. "My stuff tonight was drastically different because of that."
Wainwright, who retired the last 11 batters and ended his performance with four successive strikeouts, is tied with Jordan Zimmermann of Washington and Jorge De La Rosa of Colorado for the most wins in the NL.
St. Louis manager Mike Matheny was pleased to see his ace return to form.
"That's the same guy we expect to see every time out," he said. "He had it all working."
Wainwright fashioned a 16.88 ERA in his two previous starts.
"This time he was aggressive," catcher Yadier Molina said. "This is a long season and everyone is going to have slumps. He's a tough guy. He's going to battle."
Wainwright threw first-pitch strikes to 14 of 24 batters. He gave up a single to Andrew McCutchen in the first and a double in the fourth.
Pittsburgh manager Clint Hurdle was not surprised to see Wainwright bounce back.
"He was down in the zone all night, he wore it out," Hurdle said. "He did what he's done for years."
"We've been back-and-forth with them all year," Wainwright said. "Any time you can win against them, it's a big win."
Freese homered off reliever Jeanmar Gomez in the sixth to push the lead to 4-0.
Pittsburgh left-hander Jeff Locke (9-5) allowed three runs on three hits over five innings. He was making his first start since Aug. 27. Locke was sent down to Double-A Altoona to clear his mind, but he did not make an appearance.
"I felt refreshed, like I was re-charged," Locke said.
Molina started a two-run outburst in the fourth inning with a double that followed a leadoff walk to Carlos Beltran. Freese then brought in Beltran with a sacrifice fly to left. Kozma added an infield single to bring in Molina.,
The Pirates are 9-9 over their last 18 games and they remain confident.
"We need to step it up, to get going again," McCutchen said. "We've just got to keep battling."
RHP Michael Wacha (2-0, 3.20) will face Charlie Morton (7-3, 3.00) in the final game of the three-game series on Sunday. ... Pittsburgh has hit an NL-leading 79 home runs on the road. ... The Pirates have out-homered St. Louis 19-5 in the 18 games between the teams this season. ... St. Louis had nine successive hits in a seven-run seventh inning during Friday's 12-8 win. The nine in a row is the most by any team in the majors this season.