Orlando, FL (SportsNetwork.com) - A five-second violation doomed the Orlando Magic in the final 10 seconds as they fell to the Toronto Raptors, 98-93, on Sunday.

The Magic trailed 96-93 with 8.9 seconds on the clock when Maurice Harkless failed to inbound the ball in time.

Demar DeRozan netted a pair from the line to seal the outcome for Toronto after the call. DeRozan finished with 28 points and Jonas Valanciunas added 20 points and nine rebounds to keep the Raptors 2 1/2 games ahead of the Brooklyn Nets for the top spot in the Atlantic Division.

Nikola Vucevic tallied 22 points and 10 boards and Jameer Nelson and Victor Oladipo scored 16 apiece for the Magic, who have lost 10 of their last 12. Tobias Harris contributed 14 points and seven rebounds off the bench.

Oladipo opened the fourth with a triple, which sparked a 14-5 run that he capped off with a layup to knot the game at 78-78 with just under nine left to play.

After trading scores, Toronto used an 11-2 burst, which Kyle Lowry provided seven of his 16 points on, to put the Raptors up 91-82 with 3:45 remaining. Orlando fired back with an 11-5 run that Arron Afflalo capped with a 3- pointer, making it 96-93.

"We're not in a position that we can just wholesale hold guys out and it's tricky, it's very tricky to make sure we cut their minutes and not give up leads but again it's something that we gotta learn to do," said Toronto head coach Dwane Casey.

Lowry missed a layup on the Raptors' next trip down the floor and, after the Magic were able to avoid a five-second violation with a timeout they were then called for the aforementioned violation, which sealed the outcome after the DeRozan free throws.

"It's not like Kyle is my designated onside kick guy, the other guys can inbound the basketball. Full confidence in Maurice being able to inbound the basketball. It's more than just that one play guys, there was a 30-point quarter we gave up in the second quarter. It's more than one possession at the end of a game," said Magic head coach Jacque Vaughn.

Orlando trailed by 18 with eight minutes left in the third before they used a 16-5 surge with 12 points supplied by Nelson, who netted the final 10 of the run. The Magic trailed 68-61 at that point and headed into the fourth quarter with a 73-64 deficit.

Toronto led by nine with just over eight minutes left in the first half before they increased the margin to 46-28 with an 11-2 burst. The Raptors carried a 19-point lead, 57-38, into the break.

The first quarter featured eight lead changes and three ties with neither team leading by more than five points. Toronto took a 27-22 lead into the second quarter following the back-and-forth frame.

Game Notes

The Raptors are now 34-7 this season when they hold their opponent under 100 points ... The Magic shot 55.1 percent from the field.