Anthony Davis had 28 points and 14 rebounds for the Pelicans, who lost their fifth straight and dropped six games below .500, both season highs.
The Mavericks, who won three of four games in a five-night stretch, almost blew a seven-point lead in the last 2 minutes after shooting 27 percent in the first half.
Davis made five of six free throws to get New Orleans within two at 106-104 with 18 seconds left.
Dallas had to call timeout after having trouble inbounding the ball, and Nowitzki hit two foul shots for a four-point lead and his first 40-point game since April 16, 2012, at Utah. He also had 40 in that one.
Darius Miller hit his fourth 3-pointer of the second half to get New Orleans within a point, and Jose Calderon hit two free throws for Dallas for the last of his 17 points. Austin Rivers tried to get off a 3-pointer at the buzzer but was tied up by Ellis, who had 26 points.