Dorian Finney-Smith put Dallas ahead for good with a 3-pointer with 3:36 remaining, and the Mavericks drew two charging calls on Orlando's Aaron Gordon in the final seconds Wednesday night to preserve a 107-106 victory over the visiting Magic.
Luka Doncic capped a 27-point effort with a pair of free throws with 2:31 remaining to give the Mavericks a 107-102 lead. But Dallas didn't score again, including two missed free throws by Seth Curry with a chance to extend a 107-106 advantage with 7.0 seconds left.
Orlando, which also failed to score again after a Gordon dunk with 1:09 to play, had a last-second chance to win, but Nikola Vucevic misfired on a 3-pointer, sending the Magic to their fourth consecutive defeat.
Orlando had two earlier opportunities to take a late lead, but Gordon, the team's leading scorer with 23 points, was called for charging fouls with 34.7 and 7.7 seconds left.
En route to just their second win in four home games this season, the Mavericks trailed by as many as 11 points in the third quarter before rallying to an 86-79 lead by period's end.
But Orlando tied the game at 91, and eventually at 98 and 100 as well, before Finney-Smith's go-ahead hoop with 3:36 remaining.
Doncic had seven rebounds and seven assists to complement his game-high point total for Dallas, which captured its eighth straight at home over Orlando in a winning streak that dates back to 2011.
Maxi Kleber added 14 points, Tim Hardaway Jr. 13, Dwight Powell 12, Justin Jackson and J.J. Barea 11 apiece, and Kristaps Porzingis 10 in a balanced Dallas attack.
Gordon's team-high point total came on 10-for-17 shooting for the Magic, who outshot the hosts 48.8 percent to 42.9.
Vucevic had 19 points and 11 rebounds to go with seven assists for Orlando, while Jonathan Isaac likewise had a brilliant all-around game with 13 points, 10 rebounds, five assists, four steals and six blocks.
D.J. Augustin and Michael Carter-Williams chipped in with 13 points apiece, and Markelle Fultz added 11 for Orlando, which had lost its previous seven games at Dallas by an average of 17.7 points.
For more sports coverage, visit the ABS-CBN Sports website.