Wainwright is 5-0 at home and has allowed just two earned runs in his last three starts covering 21 innings.
St. Louis won for the sixth time in eight games and broke a four-game home losing streak against the Brewers, who have won 13 of their last 17 at Busch Stadium.
Milwaukee lost for the fifth time in six games.
Rasmus pounded his ninth homer of the season in the sixth to put St. Louis up 4-0.
Albert Pujols drove in two runs, one on a bases-loaded sacrifice fly in the third
- his 152nd career RBI with the bases loaded.
Milwaukee starter Randy Wolf (4-5) sent the first six batters down in order on 20 pitches before running into trouble in the third. Rasmus drew a leadoff walk and Brendan Ryan followed with a single up the middle. One out later, Rasmus scored on a grounder to third by Felipe Lopez.
Wolf gave up five earned runs in 6 2/3 innings. He struck out four and walked four.
Matt Holliday added an RBI double in the seventh and Ryan Ludwick had a two-run double in a three-run eighth inning.
Brendan Ryan improved to 6-for-10 lifetime against Wolf with two of the Cardinals' nine hits.