Cardinals manager Mike Shildt ran the team in the opener. He was to miss the nightcap while serving a one-game suspension, imposed by Major League Baseball after tempers flared during the Brewers' 18-3 romp Tuesday night.
Wainwright (5-1) struck out nine in the seven-inning complete game as the Cardinals reached .500 in their bid for a spot in the expanded playoff field.
Christian Yelich hit a one-out single in the Milwaukee first and Keston Huira followed with his 13th home run. Wainwright quickly settled down and allowed just two singles and a walk the rest of the way.
Tyler O'Neill hit a solo homer in the second and Brad Miller's seventh homer, a solo drive in the sixth, put the Cardinals up 4-2.
After the first, Wainwright was only in trouble once. With two outs in the fifth, Omar Narvaez walked and Avisail Garcia singled, bringing up Yelich, coming on after a slow start.
Wainwright retired Yelich on a bouncer to second.
''I knew he was starting to feel good, but there's no way I'm loading the bases right there,'' Wainwright said. ''I'm not pitching around him, loading the bases. Too many things can happen and they've got a good squad behind him, too. You've just go to make your pitches and hope your execution matters and hope that it works.''
Brandon Woodruff (2-4), who also went the distance, allowed three earned and seven hits. He struck out five and walked none.
St. Louis snapped a 2-2 tie with an unearned run in the fifth. Harrison Bader reached on a two-base throwing error by third baseman Jace Peterson and Tommy Edman sliced an opposite-field double to left.
O'Neill answered with his sixth homer to make it 2-1. O'Neill's homer was the first of the series for the Cardinals, the first time since 2005 that St. Louis had gone without a home run over three games at Miller Park.
''Pitchers throw strikes, let our defense play and then offensively, tough at bats, tough at bats, situational at-bats and just figure out a way to get runners over,'' Shildt said.
''Baserunning's part of our offense too. Harrison did it. O'Neill with the sac fly. Eddie (Edman) with two strikes. Those runs clearly count. They matter. They end up showing up. That's what we're anchored to. That's winning baseball,'' he said.
Shildt also received an undisclosed fine after he was involved in a benches-clearing incident in the fifth inning of Tuesday's game. Shildt and Brewers manager Craig Counsell were both ejected following a catcher's interference call against the Cardinals Yadier Molina. ''I understand it and I accept it,'' Shildt said after the first game. ''I guess the mask, (taking) the mask off got me. I understand and support Major League Baseball's decision. I had a good conversation with the commissioner's office today.''
Cardinals: RHP Johan Oviedo (0-2, 4.66 ERA) was activated off the injured list after passing a rapid test for COVID-19 and was scheduled to start the second game of the doubleheader. LHP Rob Kaminsky was designated for assignment. OF Justin Williams was recalled from the alternate training stie as the 29th player for the doubleheader. INF Max Schrock and RHP Junior Fernandez were recalled from the alternate training site. OF Lane Thomas and RHP Nabil Crismatt were optioned to the alternate training site.
Brewers: RHP Josh Lindblom was placed on the bereavement list and RHP Justin Topa was recalled from the alternate training site. LHP Eric Lauer was recalled from the alternate training site as the 29th player for the doubleheader. INF Ronny Rodriguez and RHP Trey Supak were outrighted to Triple-A San Antonio.
Cards: Molina, who caught an additional two innings before leaving Tuesday's game after being hit in the hand by Ryan Braun's bat, was back in the lineup after a CT scan earlier Wednesday, but was batting ninth. ... 2B Kolten Wong, who missed Tuesday's game after experiencing discomfort in his left side while warming up, said he had an MRI that showed no structural damage, but was not in the lineup for the first game. ''The only time I feel pain is when I swing,'' Wong said. ''Running and defense might be something I can still do. I'm going to try and take some swings and see how it goes, but for the most part I know I can come in as a defensive replacement.''
Cards: RHP Dakota Hudson (3-2, 2.92 ERA) opens the five-game series Thursday at Pittsburgh, which includes two games on Friday, the Cardinals' third doubleheader of the week. Hudson has won his last three starts. He allowed one run on one hit in six innings in his last outing, although he walked four.
Brewers: After a day off, RHP Adrian Houser (1-5, 5.40 ERA) opens the three-game series Friday at home against Kansas City. Houser, 1-0 with a 0.75 ERA in his first two starts, is 0-5 with a 7.01 ERA over his last seven starts.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Copyright 2020 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.