The Raptors held on despite 23 points and a huge fourth quarter from old teammate Jose Calderon.
Toronto trailed 108-107 after a 3-pointer by Calderon when DeRozan’s pump-fake got Brandan Wright and Shawn Marion in the air. DeRozan threw up a shot as he was bumped and it went in for the final points with 1:11 remaining.
He missed the free throws but the Mavericks missed their last four shots, including a runner by Monta Ellis in the final seconds.
Kyle Lowry led four Toronto players in double figures with 20.
Dirk Nowitzki scored 22 for the Mavericks but missed his last six shots.
Down by a point, the Mavericks missed three times in one trip in the final minute when Nowitzki misfired from 3-point range and Calderon was off target after the rebound bounced back to him beyond the arc.
With a chance to reset, the Mavericks got the ball to Nowitzki again, but he missed a fadeaway jumper from the baseline. He was 10 of 22 from the field.
Lowry’s missed jumper set up Dallas’ final attempt with Ellis.
Toronto had its biggest lead at 89-81 when Calderon scored 11 straight Dallas points to get the Mavericks to 93-92. Calderon then drove and zipped a pass to Nowitzki for a 3-pointer to put Dallas in front 95-93.
Calderon also assisted on Shawn Marion’s go-ahead basket with 20.9 seconds left, but DeRozan got Toronto even at 101-all with a tough jumper over Marion just 4 seconds later.
Nowitzki missed a turnaround jumper with Amir Johnson defending just before the buzzer to end regulation.
The Mavericks had gone ahead 99-98 when Calderon won a battle for a rebound and found Marion alone at the other end for a dunk with DeRozan desperately trying to catch him.
Jonas Valanciunas had 18 points and 13 rebounds, including a sequence where he rebounded his own miss twice and eventually scored for a 93-89 lead.
Johnson and Terrence Ross scored 15 apiece for Toronto.
The Raptors started the fourth quarter on an 11-0 run for an 89-81 lead. Greivis Vasquez had eight of his 14 points during the spurt, including a pair of 3-pointers on assists from DeRozan, who also had one from long range.
Ellis inbounded to Nowitzki with 2.9 seconds left in the third quarter, sped around Nowitzki as he got the ball back and hit a high-arching finger roll layup just before the buzzer to put the Mavericks up 81-78.
Ellis had 21 points and 11 assists, while Marion scored 14 and matched Nowitzki with a team-high nine rebounds.
The Mavericks had to fly to Phoenix after the game for their eighth back-to-back of the season and third game in four nights after they had a three-day break between a pair of home games.
NOTES: Mavericks G Devin Harris is now targeting a January return after a setback in his recovery from off-season toe surgery on his left foot. He has stopped basketball activities because of swelling. … The Mavericks went on a 14-1 run to build a 41-22 lead in the second quarter, but the Raptors answered with a 27-6 run to take a 49-47 in the final minute of the first half.