ORLANDO, Fla. (AP) -- Arron Afflalo had 32 points, rookie Victor Oladipo added 30 points and a career-high 14 assists, and the Orlando Magic rallied to beat the New York Knicks 129-121 in double overtime on Friday night.
The Magic trailed by as many as 14 points, but got 25 points and 10 assists from Oladipo after halftime to stave off the Knicks. Tobias Harris added 22 points.
Orlando snapped a three-game losing streak in its first game following the departure of Glen Davis, who had the remainder of his contract bought out earlier in the day.
Carmelo Anthony led the Knicks with 44 points, but only 14 came after the third quarter.
The Knicks' loss ended their eight-game game win streak over the Magic. New York has last four of its last five.
Afflalo found Oladipo for a layup to put the Magic in front 117-113 in the second overtime. But Afflalo injured his right ankle in the process by stepping on Raymond Felton's foot and didn't return.
Orlando was dealt another blow on the next Knicks' possession when Nik Vucevic was whistled for his sixth foul. Anthony then hit a pair of free-throws to get New York back within a basket.
Oladipo answered, getting fouled when he fought past Tim Hardaway Jr. for a layup. He completed the three-point play to push the lead back to 120-115.
The Knicks got it back to a point before another three-point play by Oladipo made it 125-121 with 30.7 seconds left.
Felton had a 3-pointer rattle out on the other end, forcing the Knicks to foul and Orlando sealed the win at the free throw line.
Felton hit back-to-back jumpers to put New York up 113-111 with less than three minutes to play in the first overtime.
Oladipo quickly countered on the other end with a driving layup before Felton sprinted ahead and found Tyson Chandler for a reverse slam. But the ball bounced off Chandler's head and popped up and out of the rim. Chandler was called for offensive interference and the basket was waved off.
The Magic got the ball, but Afflalo's pass was knocked away by Chandler and prompting a Knicks' timeout with 41.6 remaining.
Anthony briefly got open in the lane, but could only get off a leaning 16-footer that hit off the rim and was rebounded by the Magic, who called their own timeout with 8 seconds left.
Orlando got up several shots at the rim, but Vucevic's final tip attempt fell short.
The Knicks led by as many as 14 in the third quarter before the Magic trimmed it down to 86-83 in the opening minutes of the fourth.
Afflalo sent it to overtime when he hit a step-back jumper with 42.9 seconds left to tie it 106-all.
NOTES: The Magic improved to 1-4 in overtime games this season. ... J.R. Smith made his 12th start of the season in place of injured swingman Iman Shumpert, who is expected to miss about two weeks with a sprained ligament in his left knee. ... Former Magic player Penny Hardaway was honored in a ceremony between the first and second quarters as part of the team's ongoing "Legends Nights" to celebrate the franchise's 25th anniversary season.