Wainwright (12-10) tossed his second shutout of the season and fourth of his career, scattering five hits while walking one.
The right-hander retired 13 of the first 14 Houston batters and tossed 71 of his 104 pitches for strikes as the Cardinals took their second straight in a three-game series.
Skip Schumaker's two-run single capped a four-run first inning that staked National League wild-card-contending St. Louis to an early lead.
Yadier Molina went 3-for-4 with a pair of run-scoring singles for the Cardinals.
Lucas Harrell (10-9) was roughed up for six runs on eight hits in a five-inning effort for the Astros, who fell to 12-49 on the road.