Ibaka, who was traded from the Thunder to the Magic in the offseason, scored a career-high 31 points and added nine rebounds and four blocks.
With the score tied in the final minute, Westbrook missed a pull-up jumper, and Orlando rebounded and called timeout with 11 seconds remaining to set up Ibaka’s winner with 0.4 seconds left.
Westbrook finished with 41 points, 16 assists and 12 rebounds for his third triple-double of the season and 40th of his career. The Thunder had won 20 straight when Westbrook tallied a triple-double.
It was the third straight loss for the Thunder, all at home, after a 6-1 start.
Oklahoma City’s Victor Oladipo, who came to the Thunder in the Ibaka deal, scored 12 points.
The Magic led by 21 in the second quarter and were up 57-47 at halftime. Ibaka scored 19 points before the break to match Westbrook’s 19 points.
The Thunder rallied late in the third quarter. A putback by Enes Kanter with 1:35 left in the third quarter tied the game at 80. Oklahoma City led 84-82 heading into the fourth quarter.
The Thunder had one last shot after Ibaka’s jumper, but Nick Collison couldn’t quite connect on a lob to Westbrook.