Wainwright (5-11) struck out three batters and walked two to join Bob Gibson (251) and Jesse Haines (210) as the only Cardinals pitchers to reach the 200-victory plateau with the team.
John King retired two batters in the eighth inning and closer Ryan Helsley got the last four outs for his 12th save.
Willson Contreras homered for the Cardinals (67-83) to provide the game's only run.
Starter Freddy Peralta (12-9) allowed one run on four hits in six innings for the Brewers (84-66). He struck out six batters and walked nobody.
Peralta has held opponents to two runs over fewer in seven of his last eight starts.
Wainwright came into the game 21-14 with a 2.74 ERA in 54 career appearances against the Brewers, including 47 starts. He induced 10 groundouts, including two that produced double plays.
Brewers center fielder Sal Frelick kept the Cardinals off the scoreboard in the second inning. After Jordan Walker hit a two-out single, Frelick made an excellent running catch on Tommy Edman's would-be RBI extra-base hit into the right-center field gap.
Wainwright stranded two runners in the third inning. Brice Turang drew a one-out walk and Frelick hit a two-out single, but William Contreras grounded out to end the threat.
Milwaukee left another runner in scoring position in the fourth inning. Willy Adames hit a two-out double off the glove of diving left fielder Richie Palacios, but Wainwright struck out Rowdy Tellez.
Willson Contreras' homer put the Cardinals up 1-0 in the bottom of the inning.
Wainwright left another runner in scoring position in the seventh inning. Mark Canha hit a leadoff single, moved up on a groundout and stole third base with two outs — but Josh Donaldson flied out to leave him there.
—Field Level Media