DENVER (AP) -- Anthony Carter made all three of his baskets count. Especially that last one.
With the Rockets focusing on Anthony and Iverson on the last possession, Carter got the chance to be the hero. He got the ball at the top of the key, used a pump fake to get Bonzi Wells in the air and then stepped under him and hit the winner.
"Bonzi switched off and went to 'Melo and I was wide open," said Carter. "He went for the shot fake, I stepped under him for a little runner. In that situation you don't have a chance to think about much."
The Rockets have lost three straight and five of their last six.
"You have to make people shoot over you," Houston head coach Rick Adelman said. "You can't go for a pump fake."
"We hung tough, dug deep inside and found some energy to find a double-overtime game," said Rafer Alston, who had 18 points. "This one was tough. We were right to end and they hit a big shot."
The Rockets nearly pulled out the win. Yao's two free throws with 4.5 seconds left gave the Rockets the lead, but Carter, who had six points in the game, came through with a 15-footer.
"It looked good all the way," Iverson said. "They played good defense on 'Melo and myself, and we had another teammate step up and make a play."
The game was back and forth in both overtimes. Houston led 106-103 before Chucky Atkins, who had 13 points, hit a 3-pointer with 1:32 left.
Marcus Camby scored his only two points of the game with 59.5 seconds left, but Shane Battier hit a 3-pointer with 35.3 seconds left to give the Rockets a 109-108 lead. Atkins, who missed the first 24 games of the season with a groin injury, hit an 18-foot jumper with 20.1 seconds left to give Denver a 110-109 lead.
"We did a lot of good things, we just didn't get a chance to finish it," Adelman said. "They made two big shots at the end."
The Nuggets led 100-97 in the first overtime but a free throw by Alston with less than a minute left in the period sent the game to a second overtime.
The Rockets trailed 94-87 with 1:40 left in regulation but scored the final seven points, the last on a 3-pointer by Head.
"It was a gutty win," Nuggets head coach George Karl said. "Both teams hit shots, made some free throws. It was unfortunate somebody had to lose."
Anthony, who had eight points on 2-for-17 shooting in the first half, found his stroke in the third quarter. He hit all eight of his shots in the period, and after making a 21-foot jumper from the wing to give Denver a 69-63 lead, he pumped his fist. He scored 16 points in the period. He hit his first shot of the fourth quarter before a 19-footer rimmed out.
"I don't think I could have shot worse than I shot in the first half," Anthony said.
The Nuggets led 44-42 at halftime thanks to their advantage from the free-throw line. Denver outscored Houston 12-2 from the foul line in the first half, when the Rockets were whistled for 11 fouls to the Nuggets' five. Houston didn't attempt a foul shot until Yao went 1-for-2 from the line with 1:30 left in the second period.
Denver trailed 27-23 early in the second when Iverson, who had 18 of the Nuggets' first 26 points, scored on a three-point play and Atkins hit two 3-pointers to spark an 11-2 Denver run.
The Rockets used the 3-point shot to take the lead after the first quarter. Head hit two of them and Alston another to help give Houston a 23-18 lead heading into the second period.
Nuggets F Kenyon Martin left the game in the second half with a leg injury and did not return. He is questionable for Friday's game in Portland. ... Head started in place of the injured McGrady, who was hurt in the first half of Houston's loss to Orlando on Wednesday. ... Rockets G Steve Francis was not with the team because of the flu.