McHale took a leave of absence on Nov. 10 to be with his family as his daughter's health worsened. Alexandra "Sasha" McHale died Nov. 24 of complications from Lupus. She was 23.
Many of the Mavericks went over to McHale and hugged or patted him after introductions, and he received a standing ovation when the public address announcer welcomed him back to the team.
Dallas used a 13-2 run to take a 102-100 lead with about 4 ½ minutes left. Carter scored five points to power the run, and Brandan Wright capped it with a dunk.
Chandler Parsons made the second of two free throws for the Rockets before Mayo scored five quick points to extend the Mavericks' lead to 107-101 with less than three minutes left.
Parsons finished with 18 points and 10 rebounds, and Harden had nine assists and six rebounds.
The Rockets opened the second half with a 10-4 run to extend their lead to 76-67 with 8 1/2 minutes left in the quarter. The Rockets continued their hot 3-point shooting from the first half early in the quarter as Harden and Jeremy Lin both hit 3s to power that run.
Dallas got going after that and an 8-2 spurt got the Mavericks within 78-75 with about five minutes left in the third quarter.
Houston was up by eight near the end of the third quarter, but Jae Crowder's 3-pointer with 15 seconds left cut the Rockets' lead to 89-84 entering the fourth quarter.
The Mavericks were up by 19 points with less than two minutes left in the first quarter after a long 3-pointer by Carter and thanks in large part to a 16-point quarter by Mayo.
Houston used a 35-15 run after that to erase the deficit and take a 55-54 lead four minutes before halftime. Harden scored 17 points and Houston hit five 3-pointers in that stretch. Harden had two of them, and he waved three fingers to the crowd while running down the court after the second one.
The Rockets shot 70 percent and scored a season-high 42 points in the second quarter to just 40.9 percent shooting by the Mavericks to lead 66-63 at halftime.
NOTES: Houston's 42 second-quarter points marked the first time the Rockets have scored 40 points in a quarter since Dec. 31, 2010, against Toronto. ... Mayo has scored at least 20 points 11 times this season. ...