ORLANDO, Fla. (AP) -- After Toronto locked up its first postseason berth since 2008 last week, coach Dwane Casey cautioned the Raptors to not get complacent down the stretch with teams still vying for playoff position.
He's hoping that a nearly disastrous letdown against Orlando will send a stronger message.
Toronto led by as many as 21 points before having to stave off Orlando's late charge.
Trailing 96-93 with 8.9 seconds to play, the Magic had the ball and an opportunity to tie the game. But coming out of a timeout they failed to inbound the ball, turning it over on a 5-second violation. DeRozan was fouled and hit a pair of free throws to save the win.
''They saw the 20-point lead and like any NBA team, they let their guard down,'' Casey said. ''That's a development we've got to have - to keep the intensity, keep your foot on their neck and keep it down.''
Kyle Lowry added 16 points.
The win was the Raptors' third in a row and seventh straight over the Magic. Toronto swept the season series 3-0.
''We still haven't done anything yet in this league. We haven't played a playoff game, we haven't won a playoff series, we haven't done anything, so we still have a long way to go and we understand that,'' DeRozan said. ''It's time to take the next step, finish the season off strong, and then the next step will come after that.''
Nik Vucevic led the Magic with 22 points and 10 rebounds. Jameer Nelson and Victor Oladipo each added 16 points.
Orlando shot 55 percent for the game, but also had 19 turnovers that led to 19 Raptors' points.
DeRozan had more free-throw attempts (16) than the entire Magic team.
Asked about the 27-14 discrepancy in attempts between the teams, Orlando coach Jacque Vaughn brushed it off.
''I'm just going to say the referees were great throughout the game. I'll leave it at that,'' Vaughn said.
After struggling offensively for most of the second half, the Magic cut a 21-point deficit to 76-73 on a layup by Tobias Harris with 9:53 to play in the game.
A driving layup by Oladipo a few possessions later tied it at 78.
Orlando had a chance to take the lead, but came up empty on a pair of 3-pointers.
The Raptors settled down and carved out an 87-80 cushion on a pair of free throws by DeRozan with 5:16 remaining.
Harris trimmed it to 93-88 with 1:21 left, but DeRozan responded on the ensuing possession with a 3 to push it back to eight.
It was 96-90 when a Toronto turnover gave the Magic the ball and some life with under a minute to play. Arron Afflalo took advantage with a 3-pointer to cut it to 96-93.
Lowry's layup rolled off the side of the rim on the Raptors' next touch, giving the Magic their chance to tie with 8.9 seconds remaining.
But that's when Maurice Harkless failed to inbound the ball within 5 seconds.
''Just good defense by Toronto, denying the basketball in,'' Vaughn said. ''The good thing is we'll continue to be in those situations and we'll get better at accomplishing it.''
The Raptors led 57-38 at the half, but struggled to shake free of the Magic early on.
Orlando led 20-18 in the first quarter before Toronto closed the period with a 9-2 spurt.
It continued at the start of the second quarter with a 17-4 run that gave the Raptors an 18-point cushion. Valanciunas led the surge with 16 first-half points.
Casey said his team needs to work on its mental approach before the playoffs.
''We're still learning to put games away, (and) not make games interesting at the end,'' he said. ''We've got to learn to put them away so we won't be fighting so hard the last minute or two.''
NOTES: Vucevic recorded his 36th double-double of the season. ... Raptors F Patrick Paterson missed his 13th straight game with a right ulnar collateral sprain. ... G Greivis Vasquez returned to the game in the second half after receiving five stiches to his left cheek following a collision in the first half.
Follow Kyle Hightower on Twitter at https://www.twitter.com/khightower