Toronto outscored Detroit 27-9 in the final period to take control of a game that appeared to be slipping away. The Pistons missed their final 10 shots of the game.
DeMar DeRozan added 14 points, eight rebounds and six assists for Toronto, which won for the second time in five games.
Reggie Jackson had 20 points for Detroit, which lost its third in a row. Andre Drummond had 22 points, but only had eight before fouling out in the fourth quarter.
Both teams struggled offensively in the first half, posting matching 34.1 shooting percentages. Corey Joseph hit a pair of free throws with 1.1 seconds left in the half to give Toronto a 40-38 lead.
Jackson led the Pistons with 11 points, while Drummond had 15 rebounds. DeMarre Carroll had 10 points for the Raptors.
Toronto jumped out to a 53-46 lead early in the third, but the Pistons rallied to go ahead 59-58 on Kentavious Caldwell-Pope's 3-pointer. Jon Leuer's tip in at the buzzer gave Detroit a 66-60 lead going into the fourth quarter.
The Pistons moved the lead to 72-63 in the opening minutes of the fourth, but Toronto went on a 22-2 run to take an 85-74 lead with 1:38 to play.
Raptors: Came in with a 6-9 record in the second game of a back-to-back. They are 33-20 in all other games.
Pistons: Drummond scored his 5,000th career point on a lob from Ish Smith in the third quarter. It was also the 34th time he had 20 rebounds in a game, including seven this season.
As has become customary for Raptors games at the Palace, the crowd was cheering louder for Toronto than Detroit. Heavy snow in Auburn Hills kept fans of both teams at home, but Raptors jerseys dominated the small crowd.
Raptors: Host the Indiana Pacers on Sunday.
Pistons: Host the Phoenix Suns on Sunday.