McIlroy, who missed the cut in his previous three starts and dropped out of the No. 1 spot in the world rankings, shot a 5-under 65 at the TPC-Southwind course for a two-day total of 133.
Despite making his second double bogey in two days, John Daly moved into a tie for 12th at 137 and put himself in position to challenge for his first PGA Tour victory in eight years.
McIlroy failed to finish at the Players Championship, the European PGA Championship and the Memorial Tournament prior to this event.
He came to the St. Jude Classic hoping to regain the form that made him the runaway winner at last year's U.S. Open at the Congressional Country Club and he found it Friday with five birdies and an eagle.
His U.S. Open title defense will begin next Thursday at the Olympic Club in San Francisco.
It took a score of 2-over 142 to survive the cut and among those who missed out was Zach Johnson, who won two weeks ago in Texas. Dustin Johnson, playing for the first time in 11 weeks after developing back problems, will play on the weekend after putting together a 138 total.