DENVER -- In a game in which they gave up 110 points, it was the Denver Nuggets' defense that was the difference.
The Nuggets allowed Houston to shoot better than 50 percent for three quarters before clamping down in the fourth. Once their defense got going, the offense took over in a 118-110 win Wednesday night.
Danilo Gallinari scored 27 points, Kenneth Faried had 19 and nine rebounds for the Nuggets, who won their fifth straight.
"Our defense was not very good for the first three quarters and then we started to be more aggressive on defense," said Gallinari, who tied a career high with four blocks. "That was the key to win the game."
It also capped off a great January for Denver, which went 12-3 in the homer-friendly month. After playing 22 of their first 32 games on the road, the Nuggets went 11-1 at home to start 2013.
"It was a great month. We needed a special month and I think we got it," coach George Karl said. "It puts us in position to hopefully have a great season."
The Rockets were trying to continue their recent success. They had won three straight, including a 45-point win at Utah on Monday, but their momentum was stopped by the Nuggets for the second time in eight days.
Jeremy Lin scored 22 points, and James Harden and Chandler Parsons had 21 each for the Rockets, who have lost all three games against Denver this year.
"It's tough to beat a team three times, so it was a good step forward for us," Andre Iguodala said.
The Rockets were disappointed because they felt they beat themselves. They committed 22 turnovers, including six in a key stretch late in the third and early in the fourth.
"Our turnovers caught up to us," Lin said.
Denver trailed by three heading into the final period before taking control. Two 3-pointers by Gallinari and some missed shots by the Rockets sparked a 24-3 Nuggets run that gave the home team a 101-88 lead with 6:54 left.
The Rockets, who led by eight with a minute left in the third, missed six straight shots and committed six turnovers, which helped Denver take a big lead.
"Gallinari made a couple of tough threes and then we decided we were going to do it on our own," Houston coach Kevin McHale said. "It snowballed a little bit, and they got ahead."
Houston started crawling back. A jumper by Lin -- the Rockets' first basket in more than five minutes -- and two 3-pointers by Carlos Delfino trimmed the lead to 101-95 with 4:55 left.
Gallinari answered with a corner 3-pointer to make it a nine-point margin.
Delfino's two free throws with 2:55 left made it a four-point game, but the Nuggets held on.
"Couple of calls and they got to the foul line. They got the momentum from there," Harden said. "It's tough. They are so athletic. They get out in transition. Their point guard pushed the ball; they've got so many guys who can score."
The Nuggets grabbed the early lead in the third before Houston took momentum and an eight-point lead. The Rockets seemed to be in control late in the period when Toney Douglas stole the ball from Andre Miller and Timofey Mozgov on consecutive possessions and scored on easy layups both times.
The Nuggets were able to claw back, and they trailed 86-83 heading into the fourth.
Harden had 13 points and Parsons scored 11 in the first half to help the Rockets take a one-point lead into intermission.
Iguodala led the Nuggets with 12 first-half points, while Gallinari and Faried had 11 apiece before the break.
NOTES: Nuggets center JaVale McGee missed his second straight game with a sore left shin. An MRI performed Tuesday ruled out a stress fracture. ... The Rockets have averaged 20.6 turnovers in the three games against Denver this year. Harden has 19 of the 62 turnovers. ... The NBA acknowledged that the referees in Monday's game between the Pacers and Nuggets missed a foul call on Iguodala late in the game. With 2.2 seconds left and the game tied at 101, Iguodala was credited with a steal on Paul George, but the league said it should have been a foul. "Is that the same protocol? There are a lot of games that you lose in the last minute because of calls. Most of the time they balance out," Karl said.