Wainwright (1-3) went five innings and held the Brewers to a pair of runs on six hits and didn't walk a batter in his first victory since Sept. 27 of last season.
Brewers starter Wily Peralta (3-1) lasted only four innings, allowing six runs on nine hits and an intentional walk while failing to strike out a single batter for the first time in 20 starts.
Peralta helped out on offense, putting the Brewers on the board with an RBI single in the second, but Wainwright wiped away the deficit with a one-out, two-run home run in the third.
St. Louis tacked on three runs in the fourth on an RBI double by Randal Grichuk and a bases-loaded single by Wainwright that plated a pair.
Kolten Wong made it a 6-1 game when he scored from third on a sacrifice fly to left by Dexter Fowler. Ryan Braun's throw beat Wong to the plate, which would have given Peralta an inning-ending double play, but a review revealed that catcher Manny Pina never applied a tag to Wong.
Peralta got out of the inning on a flyout to right by Aledmys Diaz.
Milwaukee added a run in the fourth on Orlando Arcia's run-scoring double, and Braun hit his sixth home run of the season in the eighth, making it a 6-3 game and extending the Brewers' streak of games with a home run to 13.
Seung Hwan Oh worked around a two-out Jonathan Villar single in the ninth for his third save.
NOTES: Cardinals manager Mike Matheny had planned to give OF Stephen Piscotty a day off Friday, but he took over in CF when Dexter Fowler had to leave the game with right heel bursitis. ... The Brewers recalled LHP Brent Suter from Triple-A Colorado Springs Thursday to provide some additional coverage in the bullpen. To make room for Suter on the roster, OF Kirk Nieuwenhuis was designated for assignment. Nieuwenhuis, 29, had just two hits and four walks in 30 plate appearances this season while playing off the bench. He appeared in 125 games a year ago and batted .209 with 13 home runs and 44 RBIs but had a .290 mark with 11 homers and 31 RBIs at Miller Park. ... Milwaukee manager Craig Counsell announced that RHP Matt Garza would make his 2017 debut Monday against the Reds. Garza began the season on the disabled list with a strained groin. He'll take the place of LHP Tommy Milone, who moved into the rotation when Opening Day starter Junior Guerra suffered a calf injury after just three innings. Milone will now work out of the bullpen.