Andres Nocioni and Luol Deng scored 15 points and Kirk Hinrich added 14 for the Bulls (6-2).
Gordon's 38 were a preseason high for the Bulls. He was 12-for-12 from the free-throw line, and finished the preseason 34-for-38 from the foul line.
Toronto forward Chris Bosh played after missing four of the last five games with soreness in his left ankle and heal. He missed his first four shots, went scoreless in the first quarter and played only four minutes in the second half, finishing with eight points.
Morris Peterson led the Raptors (7-1) with 20 points. Chicago increased its lead to 101-93 on Viktor Khryapa's 3-pointer with less than four minutes to play. Khryapa scored the Bulls' next four points with a fastbreak layup and a jumper to make it 105-93.
The Bulls posted a winning record in the preseason for the first time since 1995-96. Chicago will open the regular season Tuesday at defending NBA champion Miami, which beat the Bulls in the first round of last season's playoffs. Toronto opens the regular season Wednesday at New Jersey.
Gordon scored 19 points in the first quarter, making all eight of his free throws, and getting the rest with a mix of jumpers and drives.
He had four points in the second quarter, but added 10 in the third and five more in the fourth.