Pau Gasol added 19 points for the Lakers and Steve Nash had 15 points in his third game back from a leg injury that sidelined him for 24 games.
Leading by three points at the half, the Nuggets went on a 10-0 run capped by a 3-pointer by Gallinari for a 73-60 lead midway through the third quarter.
The Nuggets scored five consecutive points after Howard's ejection, including one of two free throws by Faried for an 84-72 advantage. But the Lakers fought back, pulling within 91-87 with a 9-3 burst near the end of the third quarter that Bryant started with a 3-pointer.
Taking advantage of a Lakers turnover, the Nuggets stunned the Lakers with five points in the final 12.7 seconds of the third, with Brewer hitting a running 3-pointer at the buzzer from 26 feet away to allow Denver to take a 96-87 lead into the fourth quarter.
"It was one of those nights when the shots start going down the basket gets big," Brewer said.
Brewer and Iguodala each hit 3-pointers in the opening minutes of the final period as Denver gained a 15-point advantage.
The Lakers cut it to 113-106 on layup by Jodie Meeks with 4:34 remaining, but Gallinari answered with his third 3-pointer of the night and Faried followed with a driving layup to rebuild Denver's lead to 118-106. Brewer hit two more 3-pointers in the final 1:19 to ice the victory.
NOTES: Faried has 12 double-doubles this season. ... Nuggets forward Jordan Hamilton was fined $25,000 by the NBA because of a vulgar exchange with a fan during the team's 112-100 Christmas Day loss to the Los Angeles Clippers at the Staples Center. ...Despite the loss, the Lakers remain the only NBA team to have a winning record against the Nuggets in Denver, (43-34) all-time. ... Gasol, who was 3 for 11 from 3-point range coming into the game, hit two of his three 3-point tries against the Nuggets. ... Denver scored a season high in points against the Lakers. The previous high was 122 points at Sacramento on Dec. 16. ... Bryant matched an opponent season-high in points against the Nuggets. Chris Bosh of Miami also scored 40 points against Denver on Nov. 13. ... Brewer also scored 27 points against Detroit on April 4, 2010.