A third-round 70 took Hanson to 16 under par, but his Ryder Cup teammate shot 69 and is now only one behind as he chases a fifth victory of the season.
South African George Coetzee's 66 brought him only three behind and then comes a further two-stroke gap to a chasing pack which includes Luke Donald, Justin Rose and Irish pair Michael Hoey and Shane Lowry.
Hanson was caught first by McIlroy and then by Belgian Nicolas Colsaerts - another of the European stars in Chicago last month - when he followed a birdie on the second with three bogeys by the eighth.
But the Swede regained control with birdies at the ninth, 11th, 13th and 15th.
McIlroy matched two of those, made a 14-foot putt to narrow the gap to one again on the 16th and then lipped out from nine feet at the next.
"The wind was blowing from the opposite direction, which made some of the holes trickier," Hanson said. "It was not as easy to go low and my driving was not great, but it was still a good round.
"I need to play better, but if I can get back to how I was the first two days I think I have a good chance.
"To win would mean a lot. This is the start of a big stretch and it's nice to find a bit of form."
He was the only member of Jose Maria Olazabal's side at Medinah not to contribute anything to the points total and was angry not to be given more than two games in the week.
McIlroy, winner of the Shanghai Masters on the course a year ago, dropped his only shot at the long third and had to wait until the 11th for his second birdie of the day, but he remains favourite for a first prize of over £720,000.
Colsaerts was only one behind when he came to the 420-yard 16th, but driving into thick rough and then going over the green with his third led to a double bogey and he followed it immediately with another, pushing his tee shot to the 17th into the lake.
That enabled Donald, Rose, Hoey, Lowry, last year's Masters champion Charl Schwartzel and Swede Alex Noren all to move into a tie for fourth on 11 under, five back.
The highlight of Rose's round was driving the green at the dogleg 380-yard 11th and sinking a 30-foot putt for eagle. He came home in 32 for a 69, but is in danger of falling further behind McIlroy in the race to be Europe's money list winner this season.
The 23-year-old Northern Irishman has already sealed the PGA Tour title in America and can take a huge step tomorrow towards emulating the double achieved by Donald last year.
Robert Karlsson played with Hanson and McIlroy, but fell 10 behind with a 75, while Welshman Jamie Donaldson, who led by four after his opening course-record 62, is now eight back after disappointing rounds of 74 and 72.