Wainwright (14-7) ended a personal four-start winless streak, yielding one run on five hits. The right-hander issued one walk in the 106-pitch performance.
Jon Jay led St. Louis at the plate, going 2-for-3 with a three-run homer and an RBI double.
Matt Carpenter drove in two runs for the Cards, who took the rubber match of a three-game series and pulled to within one game of National League Central-leading Pittsburgh.
Cubs starter Edwin Jackson (7-13) took the loss, allowing three runs (one earned) on six hits in a six-inning effort.
Junior Lake went 3-for-4 with an RBI for Chicago.