CHARLOTTE, N.C. (AP) --Jameer Nelson added 16 points and six assists and J.J. Redick had 14 points, including a big 3-pointer down the stretch for the Magic, who've won three of their past four.
Nikola Vucevic was a force inside the paint with 13 points and 13 rebounds.
The Orlando win overshadowed a career-high 32 points from Kemba Walker.
Charlotte's second-year point guard was 11 of 19 from the field. He also had seven assists.
Walker, Charlotte's first-round pick a season ago, has excelled at home. He came in shooting 45 percent and averaging 20.4 points per game at home compared to 32 percent and 12.4 points per game on the road.
The Magic shot 54.5 percent from the field, led by Davis and Afflalo, who were a combined 15 of 25.
The Magic led 92-88 when Walker hit a long 3 from the top of the key. On Orlando's next possession Davis spun to the basket, but Byron Mullens had a two-handed block igniting a fast-break layup on the other end for Walker to give Charlotte the lead with 4:07 left in the game.
But the lead was short-lived.
Afflalo gave the Magic the lead back for good seconds later with a turnaround jumper in the lane. After Davis added a free throw, Redick came off a screen and knocked down a wide open 3-pointer at the top of the key to give the Magic a 98-93 lead with 2:47 left.
As Charlotte struggled to hit shots down the stretch, Nelson made a baseline jumper just as the shot clock expired and Vucevic sent the crowd heading to the exits after scoring and drawing a foul on a nice drive and pass from Nelson to give the Magic a 105-98 lead.
Charlotte trailed most of the game, but took the lead with seven minutes left in the third quarter on a 3-pointer by Jeffery Taylor. But that lead was also short-lived as Afflalo completed a 3-point play as the Magic regained the lead. Afflalo had nine points in the third quarter.
It was back and forth from that point on with neither team leading by more than six points until the game's final seconds.
Gerald Henderson had 16 points and Ramon Sessions added 14 for Charlotte.
Orlando led 56-48 at the break behind Nelson and Davis, who had 23 combined points on 10 of 17 shooting. Led by Vucevic, Orlando outrebounded Charlotte 23-16 in the first half.
Notes: Looking for a spark, coach Mike Dunlap reinserted Gerald Henderson into the starting lineup. Henderson hadn't started since injuring his foot in Week 2.