Reggie Bullock scored a buzzer-beater as the Detroit Pistons rallied from a 19-point deficit to defeat the Raptors 106-104 making a winner out of coach Dwane Casey in his return to Toronto.
Toronto seemed to have the NBA game in control for the first three quarters but fell behind after a furious fourth-quarter fightback by Detroit and lost its second straight.
Blake Griffin led Detroit with 30 points.
Kawhi Leonard had 26 for Toronto while Pascal Siakam added 17 and Greg Monroe 14.
Trailing by as many as 19, Detroit cut the Toronto lead to 11 going into the final quarter.
A 23-9 Pistons run to open the quarter gave the visitors a 100-97 lead with less than five minutes remaining.
The Pistons are now 7-6 in the NBA's Central Division.