DeMar DeRozan nailed a go-ahead jumper with less than a minute remaining only to see the Orlando Magic answer.
But then DeRozan came through again.
DeRozan's fadeaway jumper at the buzzer lifted the Toronto Raptors to a 97-95 win over the Magic.
"I just tried to get to my shot," DeRozan said of the shot. "Usually we run it going to my right, but that was the first time we ran it going to my left."
DeRozan's right-elbow jumper gave the Raptors a two-point edge with 37.5 left before E'Twaun Moore's offensive rebound putback knotted the contest at 95-95 with 20.9 to go.
On the game-winner, Jose Calderon received the inbounds and passed to DeRozan, who began at the top of the key and dribbled left before letting go of a fadeaway from the left corner over the outstretched arms of Glen Davis and Aaron Afflalo.
"They set a screen, we switched it. I figured he didn't have enough time to pass so the shot was the play ... Both teams made good plays down the stretch. They just got the last one," Afflalo said of the play.
The high-arching shot hit nothing but net.
DeRozan finished with 22 points and seven assists for Toronto, which has won two of three on the heels of a four-game skid.
Nikola Vucevic had 19 points and 14 rebounds to lead the Magic, who have dropped four straight.
The Raptors headed into the fourth with a 77-66 lead, but an 18-6 Orlando run put the hosts in front. Davis had a layup and three-point play during the surge, which was capped on Jameer Nelson's layup for an 84-83 Magic edge midway through the fourth.
Toronto held a four-point cushion later in the frame, but J.J. Redick's four- point play tied the game at 93-93 with 53.1 ticks left.
The Raptors took a 22-20 margin after a quarter of play and a 48-47 spread heading into the break.
Afflalo finished with 14 points ... Amir Johnson tallied 21 points and 10 boards for Toronto ... Toronto committed just 10 turnovers ... The Magic held an 18-4 edge in second-chance points.