Gasol's free throws completed a 14-point comeback in the fourth quarter as Memphis snapped a two-game losing streak.
Orlando still had a chance to win the game, but JaMychal Green stole the ball from Elfrid Payton and the ball ended up in Gasol's hands under the Magic basket as time ran out.
Troy Daniels finished with 19 points for the short-handed Grizzlies, who dressed nine players due to injuries. Andrew Harrison had 11 points and eight assists.
Evan Fournier scored 28 points for the Magic, while Nikola Vucevic had 18 points and 11 rebounds. Jeff Green scored 12 of his 14 points early in the fourth as Orlando built a double-digit lead.
JaMychal Green's steal from Payton was his second in the fourth quarter. Tony Allen also had a pair and disrupted the Orlando offense after the Magic built the lead to 14 behind Green's scoring.
But Memphis finally came alive at that point. The defense of Allen and the scoring of Gasol pulled Memphis within one on several occasions in the final 4 minutes.
Memphis still trailed 94-90 when JaMychal Green converted a 3-pointer with 47 seconds left. A 3-point attempt by Vucevic with about 24 seconds remaining rattled in the rim before popping out, setting the stage for Gasol's final free throws.
After Orlando carried a 50-49 lead into halftime, things got sloppy in the third quarter, particularly for Memphis, which missed 10 of its first 12 shots. At times, the nine Grizzlies who dressed for the game seemed to feel the impact of playing the second night of a back-to-back.
But Orlando couldn't take advantage of the anemic Memphis play. The Magic connected on only five of the initial 15 shots in the quarter. That prevented the Magic from extending the lead beyond five points and they held a 68-65 lead after three quarters.