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.
Man spent 15 hours in jail for plugging electric car into an outlet at a school
Ron Burgundy interviews Peyton Manning on SportsCenter