T.J. McConnell made the go-ahead jumper with 5.8 seconds remaining, Dario Saric came off the bench to score 24 points and the Philadelphia 76ers beat the Orlando Magic 112-111 on Thursday night.

McConnell's basket in the lane came after Ersan Ilyasova won the jump ball against Evan Fournier in the waning moments of a game that featured 10 lead changes and five ties before the Sixers completed their final rally.

Moments earlier, Magic center Nikola Vucevic had blocked Ilyasova's shot in the corner with 13 seconds remaining and Orlando holding a one-point lead.

Ilyasova was the only starter in double figures with 16 points for Philadelphia, which snapped a five-game losing streak.

Fournier led Orlando with 24 points but accounted for six of the team's 21 turnovers. Vucevic added 21 points and 11 rebounds in the Magic's third straight loss.

Four reserves finished in double figures for the Sixers, with Nik Stauskas adding 13 points and Sergio Rodriquez contributing 12.

Saric's layup off a feed from McConnell gave Philadelphia a one-point lead, but Orlando reclaimed it when Vucevic hit a turnaround hook shot in the lane to make it 111-110.

The Magic got big production out of Vucevic and Serge Ibaka in the third quarter to turn their seven-point halftime deficit into a brief lead. Both had 10 points in the third, and it was Ibaka's turnaround jumper that gave Orlando its first lead since the second quarter. But Philadelphia's reserves once again came through with big contributions to reclaim the lead by the end of the period.

Orlando raced to a 15-point lead in the first six minutes, but Philadelphia charged back and took a 55-48 halftime lead.

While the Magic's bench gave them little in the first half, Philadelphia's reserves provided a huge spark. Saric came off the bench to lead the Sixers with 12 points, Stauskas and Rodriguez scored nine points apiece and Nerlens Noel added eight.

TIP-INS

Philadelphia: Rookie center Joel Embiid has missed the last seven games with the left knee contusion. The Sixers are 14-18 with Embiid in the lineup and 6-16 without him. ... The Sixers outscored the Magic 10-1 on second-chance points in the first half.

Orlando: The Magic had a couple of adjustments to their starting lineup Thursday night. C.J. Watson replaced Elfrid Payton at point guard and with Aaron Gordon out, second-year swingman Mario Hezonja started at small forward instead of veteran Jeff Green. ... Ibaka is one of three players with 80-plus 3-point field goals and 80-plus blocks this season. The Knicks' Kristaps Porzingis and Kevin Durant are the other two players.

UP NEXT

Philadelphia: The Sixers return home to take on the Miami Heat on Saturday.

Orlando: The Magic begin a two-game road swing at Dallas on Saturday night.