JaVale McGee provided a second-half lift for Denver and finished with 15 points and eight rebounds. Kenneth Faried added 13 points and grabbed 13 boards to help the Nuggets outrebound Memphis 47-33.
Denver also won the battle in the paint 50-44 and outscored the Grizzlies in second-chance points 21-16.
The victory snapped a three-game skid for the Nuggets, who handed the Grizzlies their first loss since dropping their season opener against the Los Angeles Clippers.
Rudy Gay scored 22 points, Marc Gasol added 16 and Zach Randolph had 12 points and 13 rebounds for Memphis.
Gallinari, who had been struggling with his shot this season - hitting at a 34-percent clip - scored six points in the final two minutes, including the 3-pointer, which was set up when he intercepted a pass by Gay on the Grizzlies' end of the floor.
The Nuggets closed the game on a 9-0 run.
Gallinari, who hit 7 of 15 shot attempts from the field and 10 of 11 at the foul line, had 15 points in the first half, connecting on five of his first six shots and all four of his free throws.
That helped the Nuggets, who shot 54 percent in the opening half, carry a 52-49 lead into the break.
Gay led Memphis with 11 points at the half.
Neither team led by more than five points in the opening two quarters, with eight lead changes and nine ties. There ended up being 12 ties and 12 lead changes in a tight game.
Memphis opened the second half with a 12-4 run, but McGee had eight points in the frame for the Nuggets to cut the Grizzlies' advantage to 70-69 entering the fourth.
Denver would carry its rally into the final frame with eight straight points, including six by Faried. The two teams would continue exchanging leads throughout the fourth, and were still tied at 87 with 3:35 left.
Memphis took a 92-88 lead on Randolph's tip-in with 2:14 left, but the Grizzlies didn't score again.
(Copyright 2012 The Associated Press. All Rights Reserved)