HOUSTON -- Don't tell the Houston Rockets they are out of the playoff picture just yet.
Aaron Brooks swished a jumper with 2.9 seconds left and scored 31 points to help the Rockets rally for a 125-123 victory over Denver on Monday night, snapping the Nuggets' six-game winning streak.
Houston, now five games behind Portland in the race for the last Western Conference playoff spot, has won three in a row for the first time since mid-December.
"We don't have much room for error," said Scola, who was coming off a career-high, 44-point game. "It's only like a month away, the end of the season, so we need to win games."
Scola converted a key three-point play with 41 seconds remaining to put Houston ahead 122-121.
Brooks split two free throws before Anthony drove past Shane Battier for a layup to tie it at 123. Brooks then dribbled around Anthony Carter and hit the go-ahead shot from the right of the free throw line.
"I wanted to get some space first," Brooks said. "I knew it wasn't going to be all the way to the rim. I thought it would probably be a floater before I got to the rim. I tried to get open and get a shot off."
The Nuggets led 104-93 with 10 minutes left in the game after trailing by as much as 16 in the first half. Battier's corner 3 with 8:05 left capped a 7-0 spurt to draw the Rockets within four.
Anthony was concerned with how the Nuggets played down the stretch of Monday's game.
"I don't think we'll be able to get away with that, come playoff time," he said. "That's something that's fixable and we need to do it quick."
The Rockets couldn't crack the four-point deficit until Scola swished a jumper from the wing with 3:25 to go to cut it to 115-113.
Denver stretched the lead to five, but couldn't put away Houston. Trevor Ariza's 3-pointer with 1:09 left made it 121-119, Arron Afflalo missed a 3 and Scola rebounded. He got the ball to Brooks, then charged down the lane for a tying layup. Billups fouled out on the play and Scola hit the ensuing free throw to put the Rockets ahead.
"The last couple of games, I think we played great," Scola said. "Today, we fought."
Until then, Anthony and the Nuggets seemed to have the game in hand.
Houston led by 11 at the half, but Billups sank consecutive 3-pointers early in the third quarter to get the Nuggets going. His tip-in with 4:36 left tied it at 83-all and Anthony made a 3-pointer 30 seconds later to give Denver its first lead of the game.
Anthony scored 11 in the third quarter, then knocked down a 3, a baseline jumper and a straight-on jumper in the first two minutes of the fourth to stretch Denver's lead to double digits.
The Rockets shot 59 percent (23 of 39) in one of their best first halves of the season to lead 68-57 at the break.
Houston hit 13 of its first 17 shots, many of them layups, and generated 10 fast-break points in the first nine minutes to lead 32-20.
Denver rallied after Houston coach Rick Adelman went to his bench early in the second quarter. The Rockets gave away three turnovers in the first three minutes, and Smith scored six quick points to cut the Nuggets' deficit to six.
Martin returned with 9:37 left in the half and scored seven points during a 16-6 spurt to push the lead to 58-42. Denver botched simple layups early and Nene missed a one-handed dunk try with 4:24 remaining in the half.
Anthony had 19 points at the break, despite going 7 for 16 from the field.
"I was just trying to be aggressive," Anthony said. "First half, Shane was playing a game with my face. Once I figured that out, it was just my natural rhythm."
The Nuggets reached 110 points for the sixth time in seven games. ... Anthony has seven 40-point games this season. ... The Rockets shot 57 percent (45 of 79) and improved to 12-0 this season when they top 50 percent. ... Brooks hit a 3-pointer for the 38th consecutive game, a franchise record.