The victory breaks a season-long five-game winning streak for the Astros and ends a three-game skid for the Cardinals.
Allen Craig also homered for St. Louis, getting things going with a two-run shot in the first inning.
Greene's two-run home run in the fourth pushed the lead to 6-0 and his solo homer in the eighth made it 8-1.
Wainwright (2-3) allowed seven hits and one run with seven strikeouts in seven innings. He improved to 10-1 in 17 career appearances against the Astros - his most wins against any team.
Houston starter J.A. Happ (2-2) allowed six hits and a season-high six runs - five earned - in five innings.
Greene entered the game with eight hits in 18 games this season.
His performance on Sunday, where he finished 3 for 3 with a walk, doubled the RBI total he had entering the game.
Greene walked and stole second base in the sixth inning before scoring on a two-out single by Rafael Furcal.
Matt Holliday walked in the first before Craig's two-out homer, which bounced high on the wall above the Crawford Boxes in left field, gave St. Louis a 2-0 lead.
The Cardinals added a run in the second on an RBI double by Greene to make it 3-0.
Carlos Beltran walked to start the third inning. He was out at second on a fielder's choice on a grounder by Holliday. Holliday, who tripped leaving the plate, reached second on an error by Jose Altuve. A double by Craig sent Holliday home to push the lead to 4-0.
Jay robbed pinch-hitter Justin Maxwell of a hit with a nifty catch while sliding to his knees near the wall in left center field in the fifth inning. Brian Bogusevic one-upped him in the seventh when he denied David Freese of a home run when he jumped and reached back into the stands in right field for the catch.
Houston's Jordan Schafer went 0 for 4 to end his streak of reaching safely in 25 straight games to start the season. The mark ties a franchise record which was also reached by Denis Menke in 1969.
Notes: St. Louis 1B Lance Berkman, on the 15-day disabled list with a pulled left calf, experienced some discomfort when he ran on Friday, but felt better when he ran again on Sunday. ''I want to get to where I can't even feel it at all and it's not there yet,'' he said. ''But it's a marked improvement over two days ago. I'm going to try to run again (Monday) and try to push it a little bit more.'' ... Sunday was Altuve's 22nd birthday.
Link to boxscore: St. Louis 8, Houston 1