DENVER (AP) -- This time, the Sacramento Kings enjoyed their trip to Denver.
DeMarcus Cousins added 27 points for the Kings, who snapped a nine-game losing streak to the Nuggets at the Pepsi Center. It was Sacramento's first win in Denver since a 118-115 victory on April 5, 2008. The Kings have won three of their last four games overall, including both ends of a back-to-back.
''The third quarter kind of dictated the game,'' Thomas said. ''We were getting stops and we got out and ran. That's when we're at our best, when we're in transition. We were in attack mode. Rudy started it off, DeMarcus got easy buckets and I just got what they gave me. I was making open shots. We played a helluva third quarter.''
Randy Foye and Evan Fournier each scored 27 points for the slumping Nuggets, who lost for the seventh time in the last eight games. The Nuggets fell to 1-5 without leading scorer Ty Lawson, who missed a sixth game because of a fractured left rib.
''We basically controlled the whole first half, did what we wanted to do, and then we came out and gave up 39 points in the third quarter. That's unacceptable,'' Foye said after Denver managed just 18 points in the third.
''It's tough, man. But we've got to stay together, we've got to keep fighting and keep believing; don't give in. That's the main thing. Everybody goes through times like this during the season. It's important for us to continue to fight, to keep pushing.''
Down 58-51 after Foye hit a pair of 3-pointers in the third, the Kings responded with a 21-2 run that put them in front 72-60 with 4:55 left in the period.
Gay scored nine points in the decisive stretch, including consecutive three-point plays. Cousins hit a couple of jumpers and Thomas twice connected from 3-point range, with Kenneth Faried's mid-range jumper accounting for Denver's only points during Sacramento's surge.
''I wouldn't say it was the best quarter we put together all year but it was pretty good,'' Gay said. ''We got back defensively, Fournier was hurting us in the first half, we got out and guarded him. They still hit a couple of tough shots but for the most part we attacked, got to the foul line and found the open man.''
The Kings carried an 87-70 lead into the fourth quarter.
A 3-pointer by Wilson Chandler pulled the Nuggets to 94-84 with 6:41 left, but the Kings scored the next nine points, including another three-point play by Gay.
The Nuggets opened a 13-point lead midway through the second quarter. Fournier connected on two 3-pointers and Jan Vesely, making his home debut after being acquired Thursday from Washington, broke through for a pair of dunks.
Sacramento pulled to 52-48 at halftime, outscoring the Nuggets 8-1 in the last 2:10 of the second quarter, with Gay driving for a dunk to close the spurt.
NOTES: Nuggets F Darrell Arthur missed the game after he strained his left hip during Friday's loss at Chicago. ... The Kings announced that Jason Terry, who was acquired from Brooklyn with Reggie Evans in exchange for Marcus Thornton, will miss the rest of the season so he can continue rehabilitating a knee injury. ... Sacramento has scored 100 or more points in three of its last four games. ... Gay surpassed 20 points for the third time in four games. ... Fournier's 27 points were a career high, surpassing his previous best by two.