After trailing by as many as 23, the Spurs staged a fourth-quarter comeback to tie the game in the waning seconds on a dunk by Manu Ginobili, setting up Gay's last-second heroics.
Gay finished with 23, none bigger than the final game-winner. Mike Miller led the Grizzlies with 31 points.
For stats and boxscore, check out CBS online.