Kawhi Leonard had a game-high 30 points and hit the game-winning shot with 4.2 seconds left as the Raptors defeated the Brooklyn Nets 127-125.
Marc Gasol had 16 points off the bench in his home debut for the Raptors (42-16), scoring 11 of those in the fourth quarter.
Gasol was acquired from the Memphis Grizzlies at last week's NBA trade deadline as the team bolstered its roster for a post-season push.
Serge Ibaka added 18 points and 12 rebounds for the Raps and Pascal Siakam had 17 points.
D'Angelo Russell had a team-high 28 points for the Nets (29-29), who made 20 three-point baskets.