Trailing by a point with five seconds remaining, Toronto's newest acquisition drained the go-ahead jump shot just before Ty Lawson's attempt to give the visitors the win bounced off the rim as the final buzzer sounded.
"He is a big-time player. He is a closer. His roll card has 'closer' all across the front of it," Raptors head coach Dwane Casey said when asked about Gay's game-winning shot.
"He has done it at high levels like in the play-offs ... I have seen him do it so many times. That is what he does."
With the win, the Raptors (20-32) moved to within six games of the eighth and final playoff spot in the Eastern Conference but, perhaps more importantly for fans of the long struggling team, improved to 4-2 since acquiring Gay last month.
Gay, who also had the game-winner last Friday in Indiana, entered the game averaging 23.4 points for the Raptors after scoring 17.2 per game with the Memphis Grizzlies this season.
He got off to a fast start against the Nuggets, scoring 13 points in the first quarter as Toronto built their biggest lead of the game. But the 26-yeard-old forward got into foul trouble and had to watch from the bench until late in the game.
"Oh man, my hands were sweating and I couldn't stop moving my legs, I was itching to get out there," said Gay, who finished with 17 points. "Obviously it's not a game I am proud of but I am proud to get this win with the team."
DeMar DeRozan had a team-high 22 points for the Raptors, who take a three-game winning streak to New York for a game against the Knicks on Wednesday.
For Denver (33-20), playing in their first game since the team's longest winning streak in nearly eight years ended in Sunday's triple-overtime loss to the Boston Celtics, the loss was their fourth in 19 games.
Lawson paced the Nuggets with a game-high 29 points.