McGrady scored 24 points, Alston had 23 points and fell just short of a triple-double, and Yao added 23 points and 12 rebounds in the Houston Rockets' 114-100 victory over the Toronto Raptors on Friday night.
The Rockets, who never trailed, have won five of six.
Alston, who played parts of two seasons with Toronto, had nine assists and eight rebounds before fouling out with 3:26 to play.
"It felt good. My whole rhythm tonight felt great," he said.
"It was a big one. We needed to come in here and get a road victory. We need to keep on trying to make a good run at the third spot in the West."
Drafted by Toronto in 1997, McGrady had seven assists for the Rockets (41-25), who avenged a Feb. 28 home loss to Toronto.
"Last time we didn't have Yao," McGrady said. "We were more prepared tonight than we were the first time we faced them. It also helps when you make your shots."
Rockets coach Jeff Van Gundy said Yao got better as the game wore on.
"I thought he was better in the second half than the first," Van Gundy said. "I thought his pick-and-roll defense was better than it had been, as was his rebounding."
Yao played for the seventh time since missing 32 games with a broken right leg.
T.J. Ford scored 18 points and had eight assists for the Raptors (36-30), who lost for the first time in five games.
"We tried everything to stop them but we just couldn't," Ford said. "We could not get over the hump. Every
time we had a chance we just couldn't come up with the shot to get us over the hump."
"The only thing I can say is that it is a disappointment," Toronto coach Sam Mitchell said. "We had guys in position to make some plays, but they shot the ball a little tentative. You've got to shoot the ball, you've got to drive to the basket. We got hesitant after we missed a couple of shots."
The Rockets made all five of their 3-point attempts in the opening quarter and reeled off a 15-0 run at one stretch to lead 35-18 after 12 minutes.
"It's great for us to set that tone," McGrady said. "It got us going right away. Once we got a comfortable lead it was all about staying focused and staying poised."
Mitchell called time out midway through the second quarter with his team down 50-28, their biggest deficit of the night. His message spurred a 14-4 run that put the Raptors back in the game. Toronto went into the break trailing 62-53.
The Raptors drew to 64-57 early in the third, but never got closer the rest of the way.
Before the game, the Raptors activated guard Darrick Martin and forward Pape Sow in place of guards Jose Calderon and Anthony Parker, who both have sprained ankles. ... Houston out-rebounded Toronto 47-33. ... Toronto's two offensive rebounds matched a franchise low.