The shot to left field, which bounced onto the roof and over the Marlins' office building, was Stanton's second three-run home run in as many games. The slugger has four homers and 12 RBIs this spring.
"You can tell he's starting to swing the bat well," Marlins manager Mike Redmond said. "You can tell he's feeling good. That's fun to watch. It was a big situation. He got a good pitch to hit. He had a great at-bat. He had a couple of good at-bats today. It's fun to see. I think everybody enjoys watching him get a hold of one."
Jake Marisnick had three singles and scored two runs for Miami, and Stanton went 2-for-3 before being lifted for a pinch-runner in the fourth inning.
Backed by Stanton's blast, Jacob Turner was able to cruise through five innings, as the right-hander gave up one run on two hits with three walks and three strikeouts.
Astros lefty Dallas Keuchel, competing for a rotation spot, entered the game with nine scoreless innings spread over three games. In four innings, he was tagged for seven runs on 13 hits.
The Astros led by a run in the first inning on Chris Carter's sacrifice fly to center field. Turner was hurt by a one-out walk to Jonathan Villar. The Marlins right-hander also committed a throwing error while trying to pick Villar off first. Marc Krauss' single moved Villar to third, and he scored on Carter's fly ball to center.
Derek Dietrich padded Miami's lead with an RBI double in the seventh inning.
Steve Cishek threw two scoreless innings of relief with two strikeouts for Miami.
Houston's Anthony Bass also tossed two shutout innings.
Up next: The Marlins have their lone Spring Training off-day on Wednesday. On a back field at the Roger Dean Stadium complex, projected fifth starter Tom Koehler will throw six innings, and Brad Hand will throw one inning in a Minor League game.
On Thursday, the Marlins return to Grapefruit League play to face the Cardinals at 1:05 p.m. ET. Jose Fernandez, who will start on Opening Day, will get the call. Fernandez is building up to more than 70 pitches. The game will be available on MLB.TV.