Orlando trailed by as many as 16 points in the first half and didn't take its first lead until Nikola Vucevic knocked down back-to-back buckets for a 91-89 edge with 4:46 remaining.
The Magic's lead was one, 94-93, with 1:12 left before Josh McRoberts and Kemba Walker each found the bottom of the net around a Vucevic miss to give Charlotte a 97-94 lead with 14.6 ticks to play in regulation.
However, Afflalo answered with a triple from the top of the key and Walker missed a right elbow jumper as the final horn sounded to force overtime.
In overtime, Walker hit a hook shot with 2:41 left for a 101-99 lead, but Nelson drilled a trey at the other end to give Orlando the lead for good, as the Magic held the Bobcats to just one field goal the rest of the way.
Vucevic posted 24 points and 23 rebounds, while Afflalo finished with 17 points for the Magic, who have won two straight on the heels of a nine-game slide.
Walker and McRoberts each scored 24 points to pace the Bobcats, who have lost four of their last six games. Despite the recent rough patch, Charlotte still occupies the seventh spot in the Eastern Conference standings, three games ahead of eighth-place Atlanta.
Celebrity Couples of 2014 [PHOTOS]