Nuggets top Celtics
Ty Lawson also had 26 points and added six assists, and Kenneth Faried had seven points and 16 rebounds for the Nuggets, who snapped a three-game skid.
Jeff Green led Boston with 20 points, and Avery Bradley added 17.
The Nuggets avenged a triple-overtime loss nine days ago in Boston. The Celtics pulled out that game after Green and Paul Pierce hit 3-pointers to force the last two overtimes.
They couldn't find the same magic in Denver.
The game was tied at 65 late in the third quarter when the Nuggets started to take control. A 3-pointer by Gallinari and two layups by Corey Brewer gave Denver a 78-70 lead heading into the fourth.
The Celtics wouldn't go away, though. Denver missed four shots to open the fourth, and Green's 3-pointer cut Boston's deficit to 80-79 with 8:55 left.
Bradley tied it with a 3-pointer with 5:34 left, but Gallinari answered at the other end to make it 87-84.
Lawson hit a floater in the lane to extend the lead to five, and after Kevin Garnett missed two free throws, Faried's putback made it 93-86 with 2:35 left.
Green hit a running layup and Jason Terry sank two free throws to pull Boston within 94-90 with 1:09 left.
The Celtics had a chance to get within two in the final minute, but Garnett missed a contested layup and Lawson hit two free throws to seal it.
Lawson scored 10 points in the second quarter, including a 3-pointer with 36 seconds left to put the Nuggets up 49-48. Courtney Lee hit a 17-foot jumper at the halftime buzzer to give Boston a one-point lead.
NOTES: The Nuggets got Gallinari and Andre Iguodala back in the lineup after both missed the previous two games. Gallinari was out with a sinus infection, and Iguodala suffered a strained neck in the triple-overtime loss in Boston. Iguodala scored just one point in 29 minutes Tuesday.