Gay made all six shots from the field, five of them from outside the arc. Mike Miller and Juan Carlos Navarro scored 11 apiece for Memphis, though the two long-range shooters were a combined 7-of-22 from the field.
Brian Chase, the rookie from Virginia Tech, led the depleted Heat with 19 points on 8-of-13 shooting from the field. Jeremy Richardson scored 15, while Jason Williams finished with 11, the only Miami starter in double figures.
Miami is winless in six preseason games.
The game was an opportunity for players on the bubble to get extended playing time because of injuries to top players on both teams. Shaquille O'Neal, Dwyane Wade and Alonzo Mourning were among five Heat players who didn't travel. Smush Parker traveled but had flu-like symptoms, while Antoine Walker was available, but never got in the game.
Miami coach Pat Riley made a conscious effort to give minutes to younger players, such as rookie Joel Anthony with 30 minutes, Chase with 28 and Richardson with 27.
Meanwhile, the Grizzlies were without leading scorer and rebounder Pau Gasol, who is recovering from a left ankle sprain that will keep him out at least two games.
Memphis, which never trailed in the game, carried a 61-52 lead halftime.
Swift worked around the rim in the early going, scoring 13 of his 14 first-half points in the opening quarter. Gay also had 14 points in the half for the Grizzlies.
Despite the younger lineup, Miami still managed to shoot 50 percent in the half. The Heat cut the lead to 66-65 midway through the third period, but Memphis extended the advantage to 84-75 entering the fourth.