Updated

Randy Foye made a go-ahead 3-pointer with 1:11 left, and the Denver Nuggets hung on to beat the Dallas Mavericks 102-100 on Saturday night.

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, his third 3-pointer in the period.

Carter hit another 3-pointer, pulling Dallas within 86-85 with 10:13 left to play.

Faried answered with a short jumper but Dallas got consecutive baskets from DeJuan Blair and Ellis to go in front 89-88, its first lead since midway through the first quarter.

The game remained tight in the final minutes, with the teams alternately taking the lead. Dallas put together a 6-0 run that included consecutive jumpers by Nowitzki that put the Mavs up 100-98 with 2:02 remaining.

That set the stage for Foye's go-ahead 3-pointer with 1:11 left to play as the Nuggets regained the lead 101-100.

After Nowitzki missed a jumper, Faried rebounded and was fouled by Blair, making one of the two free throws with 14.7 seconds left.

Nowitzki missed a long jumper in the final seconds as the Nuggets hung on.

NOTES: The Nuggets' Andre Miller registered his 7,988th assist in the NBA on an alley-oop pass that Chandler converted into a dunk midway through the second quarter, surpassing Rod Strickland for ninth all-time. ... Ellis has scored at least 18 points in each of the Mavericks' first 14 games. ... Chandler has scored 10 or more points in four of his first six games since returning from a hamstring injury that sidelined him for the first two weeks of the season. ... Dallas missed a chance to sweep a back-to-back for the first time this season. The Mavericks beat Utah 103-93 the night before and fell to 3-2 on the second night of a back-to-back this season.