Russell Westbrook added 19 points, nine assists and six rebounds and Serge Ibaka finished with 14 points and 13 rebounds for the Thunder, who had dropped two straight entering the game. Kevin Martin scored 15 off the bench in the win.
Maurice Harkless scored 25 points and pulled down nine rebounds and Jameer Nelson added 16 points and 10 assists for the Magic, losers in six straight.
Orlando guard Arron Afflalo left the game in the second quarter with an apparent hamstring injury and did not return.
"It's just an unbelievable overall effort from every guy," Magic head coach Jacque Vaughn said. "As a coach you want to be proud of your team and what they're doing. Tonight's effort typifies who we want to be."
The Magic trailed by 13 points, 47-34, at the start of the second half, but managed to tie the game at 62 following a Harkless trey with just over four minutes left.
Oklahoma City then opened up a small 7-2 burst to take a 69-64 edge and led 70-66 entering the final frame.
Orlando took a 78-76 lead following a Beno Udrih jumper with 7 1/2 minutes to play, but Westbrook scored all seven points on a 7-2 run to give the Thunder an 83-80 edge just over one minute later.