Wade injured his left shoulder in the fourth quarter and was in so much pain that he had to be taken off in a wheelchair.
The Heat were 13-17 when Riley stepped down nearly seven weeks ago for operations to replace his left hip and repair cartilage in his right knee. They had gotten back on track recently, winning seven of their last eight games, but never led Wednesday and dropped back below .500.
Wade, who left with 27 points, got tangled up with Shane Battier and grimaced in pain before going to the bench. A couple of minutes later he was helped into a wheelchair and taken off the bench. He was not moving his left arm and appeared to be in severe pain as he was wheeled away.
The Heat said Wade would not accompany the team on their trip to Dallas for Thursday night's game, instead going to a Houston hospital to have his injury diagnosed.
A basket by Wade with 11:15 to go got Miami within 89-80 and Alonzo Mourning hit one free throw to cut the lead to eight.
The Rockets then added four 3-pointers, including two on consecutive possessions by McGrady to go ahead 103-88, and the Heat wouldn't threaten again.
Wade scored 13 points in the third quarter, including two straight three-point plays late in the period to cut Houston's lead to 82-74. Bonzi Wells stunned the crowd when he made a 70-foot, desperation heave at the end of the period to extend Houston's lead to 89-75. Wells, who was at the 3-point line on the opposite end of the court when he launched the shot, broke into a huge smile when he saw it fall.
Rafer Alston, who had six 3s and 20 points, got the crowd into it early in the second half when he put a move on Wade that left him standing at the free throw line while he breezed in for the easy layup.
McGrady tweaked a groin midway through the first quarter and left the game briefly to have it taped. He returned about three minutes later and said at halftime that he was fine.
The 40-year-old Dikembe Mutombo looked more spry than the younger O'Neal at times and provided a highlight of the first half when he finished a reverse layup despite being fouled hard by the Miami center. O'Neal, who finished with 20 points, has played just 14 games this season after missing two months early following knee surgery.
Late in the game, O'Neal got a bit of revenge when he had a one-handed dunk over Mutombo. But O'Neal taunted him with the trademark finger wag Mutombo does after getting a block and was given a technical foul.
The Rockets, spurred by nine quick points by McGrady, went on a 15-4 run in the first quarter that gave them a 18-8 lead. Houston outscored the Heat 9-2 late in the second quarter to push their lead to 63-48 at halftime.
Notes:@ Former Rockets coach Rudy Tomjanovich was scouting the game. ... Houston Comets star Sheryl Swoopes attended the game with her young son. The pair sat on the front row and cheered loudly throughout the second half.