TORONTO -- Forward Rudy Gay failed to score 20 points for the first time in six games as a Toronto Raptor, but he hit the biggest shot of the game.
Gay's 17-foot pull-up jumper with 4.8 seconds to play gave the Toronto Raptors a 109-108 victory over the Denver Nuggets on Tuesday before a crowd of 16,738 at Air Canada Centre.
It was only the third time in the past 18 meetings between the teams that the Raptors (20-32) have defeated the Nuggets (33-20).
Gay posted at least 20 points in his first five games since joining the Raptors from the Memphis Grizzlies in a three-team trade, a club record. This time he was hampered by foul trouble and finished with 17.
The forward scored 13 points in the first quarter and had 15 at the half, but he had three fouls before the break. When he picked up his fourth in the third quarter and his fifth with 9:33 to play in the game, he went to the bench each time.
"I couldn't get him back out there quick enough," Raptors coach Dwane Casey said. "The fouls got him out of rhythm. He is a big-time player. He is a closer. His role card has 'closer' all across the front of it. He has done it his whole career. He has done it at high levels, like in the playoffs. I have seen him do it many times."
Gay said, "It just feels good to get a win. Obviously it's not a game that I'm proud of, but I'm proud to get this team a win. I'm happy the team still had confidence in me."
DeMar DeRozan led Toronto with 22 points and tied for the team lead with eight rebounds. John Lucas came off the bench to score 14 points, hitting four 3-pointers in the fourth quarter. Kyle Lowry added 11 points and 10 assists, and Alan Anderson scored 10 points.
Denver guard Ty Lawson led all scorers with 29 points and had nine assists, but he missed a chance to win the game in the final seconds.
Anthony Randolph scored 16 after coming off the Nuggets' bench. Kenneth Faried had 15 points and 11 rebounds, and Andre Miller had 12 points in a reserve role. Kosta Koufos added eight points and 10 rebounds.
The Nuggets played without guard Andre Iguodala (right neck strain), forward Danilo Gallinari (sinus infection) and forward Wilson Chandler (left groin tightness).
"We competed," Faried said. "It says a lot that we did compete, but we didn't win. It's frustrating not to win a game even though we were short-handed. It was tough, but we fought for it."
It was the second loss in a row for the Nuggets, who lost in triple overtime to the Boston Celtics on Sunday, ending a nine-game winning streak.
"This one is even harder for me than Boston," Nuggets coach George Karl said. "The Boston game was a classic, but tonight's game you had a lot of guys who don't play much just bust for me and the Nuggets. We made them miss enough shots. If we rebound the ball, we win. It seems like the ball wasn't bouncing our way and a lot of things were going against us, but we never quit and we always fought."
Lucas hit three 3-point shots early in the fourth quarter to put the Raptors into an eight-point lead that Denver quickly reduced to two. But Lowry, Lucas and Anderson hit 3-pointers to hold off the Nuggets, and the lead was 100-96 with 4:50 to play. The Nuggets tied it again, 102-102, on Corey Brewer's reverse layup with 3:02 remaining. Anderson hit a 3-pointer from the corner to put Toronto back in front.
The lead was one after Lawson made a layup. Randolph made both free throws after Amir Johnson's fifth foul to put Denver in the lead by one with 42.6 seconds left. The Raptors had the ball with 20.6 seconds left after Anderson nabbed the rebound following a missed shot. Gay came through with a pull-up jumper with 4.8 seconds left for a one-point Toronto lead.
"Rudy came through big for us with the shot like he always does," DeRozan said. "That's big, and we just try to do the little things."
"The one thing my club doesn't understand is that the rebound is a huge factor in the last five minutes of a close basketball game," Karl said. "The offensive rebound wins more games than people give any credit to."
Gay said he was eager to get off the bench.
"My hands were sweating and I couldn't stop moving my legs," he said. "Yes, I was itching to get back in."
The Nuggets had one more chance, but Lawson missed his driving shot after a fumbled attempt to get the ball to him.
NOTES: Raptors forward/center Andrea Bargnani played Tuesday after missing Sunday's win over the New Orleans Hornets because of the flu. He did not practice on Monday, but he scored four points in 18 minutes Tuesday. ... Forward Linas Kleiza, who played 301 games with the Nuggets (2005-2009), remains out for the Raptors due to a right knee injury. ... Casey was an assistant at Seattle to Karl. ... Casey believes the best way to develop the team is to have the players earn their playing time. "You go on productivity rather than saying this guy's got to play so many minutes," he said before the game. ... The Raptors visit the New York Knicks on Wednesday, while the Nuggets visit the Brooklyn Nets the same night.