HOUSTON (AP) -- Orlando's star of the past got hurt and the Magic's star of the present carried them to a victory.
Dwight Howard had 21 points, 11 rebounds and three blocks and the Magic took advantage of former Orlando star Tracy McGrady's absence in the second half to beat the Houston Rockets 97-92 on Wednesday night.
Yao Ming scored 19 on 7-for-18 shooting and had 17 rebounds in the first faceoff of the season between two of the game's best centers.
"It was a good matchup," Howard said. "I thought I did a better job of not letting him get to the middle, making him shoot fadeaways, instead of letting him get into a good rhythm."
McGrady left with a sore left knee at halftime after going 1-for-10 from the field in the first half. He bruised the knee in Saturday's loss to Dallas and went 5-of-18 from the field in that game.
McGrady said he didn't ask to come out of the game.
"Doctors, coaches and trainers saw how I was moving out there and decided to shut me down," said McGrady. "Playing on one leg like that, when you're putting so much pressure on that leg, the leg that feels good, there is a chance you can injure that leg. And that basically is why they decided to take me out of the game."
McGrady won the scoring title twice when he played for Orlando between 2000-04. He ranks eighth in scoring this year, averaging 24 points, and without him, the Rockets looked like they had little chance against the first-place Magic.
Orlando led 44-40 at halftime, then stretched the lead to 13 in the third quarter as Houston's offense mostly misfired. The Rockets went 8-for-23 from the field in the quarter and Houston native Rashard Lewis sank a 3-pointer 15 seconds into the fourth to put Orlando up 74-62.
Yao scored on two putbacks during Houston's last-ditch 12-4 run that cut Orlando's lead to 93-92.
After the game, Yao was beating himself up for earlier miscues. He finished with three turnovers, compared to Howard's one.
"I made some low-level mistakes," Yao said.
Keyon Dooling hit two free throws with 12.3 seconds remaining to stretch the lead to three. Luther Head missed a long jumper from the top of the key with about two seconds left. Hedo Turkoglu rebounded and sank two free throws with 0.8 seconds left.
"We just willed ourselves to get a win," Howard said.
Keith Bogans added 14 points and 10 rebounds for the Magic, who beat Houston for just the second time in 11 meetings.
"That might've been my favorite game of the year," said Orlando coach Stan Van Gundy. "They defended us well, we turned it over, we had trouble making decisions. We just played extremely hard."
The Magic missed 11 of their first 12 shots and trailed 16-5. The Rockets converged on Howard every time he touched the ball, daring Orlando to shoot from the outside, and the Magic missed their first six 3-point tries.
Houston would've led by more, but McGrady was off-target from the start and seemed to be limping.
"I thought I'd give it a go," McGrady said. "I obviously wasn't myself out there."
The Rockets play in Denver on Thursday night and Coach Rick Adelman wasn't sure if McGrady would play.
Alston carried the Rockets' offense early, hitting three 3-pointers and scoring 13 points in the first quarter and a half. Alston picked up a loose ball, Orlando's eighth turnover, and a started a fast break that ended with Wells' dunk that put the Rockets up 37-27.
The Magic then launched a 15-0 spurt to take their first lead, as the Rockets' offense started to fall apart. Houston missed nine straight shots during Orlando's run and 12 of its last 13 shots before halftime.
McGrady didn't come out with the team at the start of the second half, and Orlando mounted an 11-4 run early in the third quarter.
Yao did what he could without McGrady, dunking to pull Houston to within seven, at 55-48. But the Magic's offense flowed better in the second half, and Jameer Nelson's driving layup with 4:10 left in the quarter put Orlando up 61-50. Howard wiggled free of Yao and slammed home a dunk on Orlando's next possession.
The Magic won for just the second time in their last seven games.
Howard leads the NBA with 23 double-doubles. ... Yao's rebound total was a season high. ... The Rockets went 13-for-46 (28 percent) from the field in the first half, a season low. ... Magic G Carlos Arroyo sat out for the fifth straight game with a sore left foot. ... Rockets G Steve Francis sat out with the flu.