Ty Lawson scored 20 points to lead the Nuggets, who won their fifth straight at home while ending Dallas’ four-game winning streak. Kenneth Faried had 18 points and 14 rebounds, and Foye finished 17 points.

Dirk Nowitzki had 27 points but missed a shot at the end that would have sent the game into overtime.

Monta Ellis added 25 points and Vince Carter had 16 for the Mavericks, who were without coach Rick Carlisle for most of the game after he drew two technical fouls in succession and was ejected by referee Tony Brothers with 5:14 remaining in the second quarter.

Carlisle was initially upset that officials didn’t send Nowitzki to the free throw line, ruling the Mavericks forward was in the act of passing, not shooting, when he was fouled by Wilson Chandler.

Moments later, Ellis took a hard foul from Foye and was sent to the line, but Carlisle apparently was upset the foul wasn’t considered flagrant and let Brothers know it, leading to his ejection.

Assistant coach Monte Mathis took over on the bench for Carlisle.

The Mavericks trailed by as many as 17 points early in the game and were down 65-53 at the half. But they fought back to 84-78 with 19 seconds remaining in the third quarter on a 3-pointer by Carter.