The Raptors raced to a nine-point advantage early in the fourth period only to go scoreless for more than 4 minutes while Memphis was staging its comeback.
Gay put the Grizzlies in front for good with 26 seconds left and scored 23 points. Gasol and Mike Conley had 21 points each.
Memphis won its third straight and kept the Raptors from posting back-to-back victories for the first time in five weeks.
Ray Liotta sues skin care company over use of likeness
Aaron Carter is still in love with Hilary Duff