McIlroy held a one-shot advantage over American Brooks Koepka overnight, but found the situation reversed after a brilliant scoring burst from his playing partner.
Koepka, who secured 'battlefield promotion' to the European Tour last season by winning three times on the Challenge Tour, had dropped three shots behind McIlroy when he bogeyed the fourth.
But the 23-year-old then holed from 35ft for birdie on the fifth, from 15ft for another on the seventh and from 45ft, with five feet of break, on the eighth to jump into the lead.
McIlroy had bogeyed the first hole for the second day running but then birdied the second and hit a superb long iron into the third to set up his second eagle of the week on the par five.
The two-time major winner then dropped a shot on the sixth after failing to get up and down from a greenside bunker, before a birdie on the 10th briefly got him back on level terms with Koepka.
Koepka responded with a birdie on the 11th to edge ahead again on 14 under, with McIlroy 13 under and Denmark's Thorbjorn Olesen setting the new clubhouse target at 12 under thanks to a flawless 65.
England's Steve Webster, who started the Qatar Masters last week with an albatross on his very first hole, had set the previous mark on 11 under after a rollercoaster 64 containing nine birdies, an eagle and three bogeys.
"It took me 10 minutes to work my scorecard out," Webster told Sky Sports. "I said to my dad last night I had nothing to lose, I was 40th and you might as well go for everything. Obviously I played great apart from a couple of silly holes."
Defending champion Stephen Gallacher was also not giving up his title without a fight, the Scot responding to a bogey on the eighth with four birdies and an eagle in his next five holes to improve to 12 under.
World number one Tiger Woods had long since completed his round, a 70 leaving the 38-year-old well down the field on five under.