TORONTO (AP) -- DeMar DeRozan scored 23 points, Aaron Gray set season highs with 12 points and 12 rebounds and the Toronto Raptors snapped a three-game losing streak, beating the Detroit Pistons 103-93 on Wednesday night.
Leandro Barbosa scored 17 points, James Johnson had 15 and Amir Johnson added 11 for the Raptors, who had lost seven of eight coming in.
Ed Davis scored 10 points and Jose Calderon added 15 assists as Toronto snapped a three-game losing streak against Detroit.
Greg Monroe had 30 points and 14 rebounds for the Pistons, Brandon Knight scored 16 and Tayshaun Prince had 14 as Detroit dropped to 3-14 on the road.
Jason Maxiell scored 12 points for the Pistons, who had won three of four and seven of 10 entering the game.
Up by 14 points to begin the final quarter, Toronto put the game away with a 15-6 run over the first four minutes. Davis scored six points in the spurt, capping it with a fade away jumper as he was falling down to put Toronto up 89-66, its biggest lead of the night, with 8:09 to play.
After calling timeout, the Pistons rallied with a 13-0 run. Knight hit a 3, Jonas Jerebko made a running dunk and Monroe scored six straight points before Knight added a driving layup, cutting the gap to 89-79 with 5:38 left.
Gray made two of four from the line to stop the run, then answered another 3 by Knight with a layup as the Raptors held firm. DeRozan added a free throw on the next possession, giving Toronto a 94-82 lead with 4:11 remaining.
DeRozan topped 20 points for the fifth time in seven games. He scored 12 in the first quarter as the Raptors led 28-24 after one. Toronto shot a sizzling 58 percent in the first quarter and was almost as good in the second, making 12 of 21 attempts. They led 53-45 at the half.
Toronto missed eight of its first nine shots in the third quarter, but a dunk by James Johnson and a 3 by Calderon, his first basket of the night, sparked a 17-6 run over the next six minutes. The Raptors led 74-60 heading into the fourth.
NOTES: Restricted free agent Wilson Chandler, who played in China during the lockout, was in Toronto with his agent Wednesday to " explore opportunities" with team management, according to Raptors PR staff. ... Raptors F Linas Kleiza (left knee) missed his third straight game. ... Toronto finished its franchise-record seven game homestand at 2-5. The Raptors do not play at home again until March 2.