HOUSTON, Dec. 4 (Ticker) -- Tracy McGrady made a shot when it mattered. A handful of Philadelphia 76ers didn't.

The cold-shooting McGrady sank the go-ahead jumper with 25 seconds left as the Houston Rockets snapped a five-game slide with a 77-76 victory over the slumping 76ers, who missed four shots in the final seconds.

NBA TV highlights from
The two-time defending scoring champion, McGrady was coming off a season-high 48 points in Friday's overtime loss at Dallas. But he was throttled for most of the game and missed 16 of his first 22 shots.

Even with McGrady struggling, the Rockets rallied from a nine-point fourth-quarter deficit and took a 75-71 lead before the Sixers surged back. A free throw by Allen Iverson, a dunk by Kenny Thomas and two free throws by Marc Jackson gave Philadelphia a 76-75 lead with 37 seconds to go.

On the next possession, McGrady drilled a 19-footer to give the Rockets the lead.

"On that last play, Tracy got separation and space," said Rockets coach Jeff Van Gundy, who notched his 300th career win. "After a very tough night, he made the shot."

McGrady then drew the defensive assignment on Iverson, a three-time scoring champion who penetrated and dished to Jackson, who missed one open layup, then another.

"I was just saying, 'Please don't make those shots,'" McGrady said. "I thought for sure some of those were going in, especially a couple of layups by Jackson."

"We had good looks and I missed a couple of shots at the end that I should have made that I didn't," Jackson said.

The ball was batted out to sharpshooter Kyle Korver, whose 3-pointer banged off the back rim. Aaron McKie got the rebound but was forced to take a tough shot in traffic that missed as time expired.

"I thought Korver would hit his three. That would have been the dagger," McGrady said. "But we got the win. It's definitely a big win."

"We played hard and got (four) shots at the end of the game, but it just didn't work out for us," Sixers coach Jim O'Brien said. "We got great looks. ... Marc missed two good shots at the end of the game."

Yao Ming had 20 points and 13 rebounds and McGrady scored 17 points for the Rockets, who also ended a five-game home slide. Houston won despite shooting 32 percent (24-of-76), including 3-of-23 from the arc.

Iverson scored 20 points and Jackson and Thomas added 14 apiece for the Sixers, who have lost a season-high four in a row. Philadelphia fell to 0-3 on its road trip, which ends Monday in Atlanta.

The Rockets were without forward Jim Jackson (flu) and the Sixers played without forward Corliss Williamson (knee). Houston has won five straight in the series.

Jackson's inside hoop gave Philadelphia a 71-62 lead with 5:43 to go before Houston rattled off 13 straight points framed by 3-pointers from Andre Barrett and Bob Sura for a 75-71 lead with 2:05 to go. Both were set up by passes from McGrady, who had seven assists.

"He could have had 15 or 20 if we knock down the shots," Van Gundy said.