The Bulls had an eight-game winning streak snapped and lost at home for just the third time in 18 games this season.
Orlando let an 18-point first half lead disappear and was on the verge of losing when Carlos Boozer hit a jumper for the Bulls that gave them a 91-89 lead with 2:56 to play.
Chicago then missed its next four shots while Orlando was going on its game-winning surge, one that included a layup from Dwight Howard, a 3-pointer from Anderson and two more foul shots from Anderson to give him 11 points for the game.
Anderson's 3-pointer with 1:28 put Orlando in front for good at 94-91.
Howard scored 29 points and claimed 18 rebounds while Jason Richardson had 18 points for the Magic. Orlando made 11-of-26 attempts from 3-point range.
Boozer paced the Bulls with 26 points, but defending league MVP Derrick Rose struggled throughout.
Rose made just 6-of-22 shots from the field while scoring 26 points.