Gay played in Memphis for the first time since the Grizzlies traded him to Toronto last January. He added six rebounds and four assists while the Raptors were ending a three-game road losing streak.
Toronto began the fourth quarter with a seven-point lead and held Memphis scoreless for the first 2:30 of the period.
Kyle Lowry chipped in 21 points for the Raptors and DeMar DeRozan had 18. Toronto made 8-of-15 from 3-point range and 33-of-39 from the foul line.
Mike Conley's 29 points paced Memphis, which has dropped consecutive games.