The Mavericks were given a final chance after Houston's Courtney Lee turned the ball over with 0.4 seconds left. Jason Kidd lobbed a pass to Marion for the basket.
"It was a diagrammed play and we worked it to perfection," Marion said. "This is our last preseason game and we wanted to play with energy."
Dallas ended the game on a 14-4 run in the final 4:03. Marion's basket was the first time the Mavericks led since it was 36-35 with 6:31 left in the first half.
Caron Butler scored 25 points for Dallas and Dirk Nowitzki added 20. Chase Budinger had 19 and Aaron Brooks 18 for Houston. Marion finished with 12 points and nine rebounds.
"The manner in which we lost the game was disappointing," Rockets forward Shane Battier said. "You have to finish games out, we didn't execute down the stretch."
|More on Rockets at Mavericks|
|Preseason schedule | Facts & Rumors|
Rockets coach Rick Adelman missed the game with flulike symptoms. Assistant coach Elston Turner led the team in Adelman's absence.
"I don't put too much stock in exhibition wins," Dallas coach Rick Carlisle said. "But we won this game like we've won a lot of games the last couple years with grit, know-how and resourcefulness."
The Rockets were without forward Chuck Hayes, who missed his second straight game with a right ankle injury, and guard Kyle Lowry, who was out with back spasms.
"We're still a work in progress," Battier added. "We've had a lot of key players out during the preseason."
Mavericks center Tyson Chandler missed the game with an injured right thumb. Carlisle said Chandler is optimistic that he will be available for the team's season opener on Wednesday against Charlotte.