The Cavaliers led by as many as 14 points in the third period, but fell apart down the stretch while scoring only 13 in the fourth period.
Gordon was fouled while attempting a three-point shot with 1:45 to play and made all three free throws to give the Bulls a 99-98 lead. He made two more foul shots with three seconds remaining for the final margin.
Gordon scored 24 points and Larry Hughes had 25 for the Bulls, who are five games behind Atlanta for the final playoff berth in the Eastern Conference.
James scored 33 points to lead the Cavaliers, who had won their two previous games. They fell 5 1/2 games behind Orlando for the third spot in the East.