Wainwright (19-9) worked around seven hits and tied for the major league lead in wins and shutouts.
St. Louis has won four of five and kept its advantage over second-place Pittsburgh. Milwaukee dropped 2 1/2 games behind the Pirates for the second NL wild-card spot.
Mike Fiers (6-3) held the Cardinals hitless until Wainwright singled up the middle with two outs in the sixth. It was Fiers' first start since beaning Miami's Giancarlo Stanton last week, ending his season.