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.
Boston schools pull out free condoms over wrapping complaints
Millions of Getty images now available for free via embed tool