The world number three almost holed his approaches to the last two holes to leave tap-ins for birdie and eagle.
The Northern Irishman carded 70 and trails Andy Sullivan of England.
A fog delay of almost three hours on Friday had seen round two spill into Saturday, when play was again delayed because of mist.
"I needed that," said 26-year-old McIlroy, who is on eight under par.
"I knew 18 was a good chance and 17 was downwind so I would be going in with a wedge, but I didn't quite expect to do what I did on 18. That was nice.
"It glossed over a pretty average round to be fair. But when you are not at your best, to be able to come away with a 70 and keep in touch with the leaders, I'm happy with that."
McIlroy, whose 268-yard five-wood approach to the 18th appeared to graze the edge of the hole, added: "I've never had an albatross and my dad's had one or two so that would have been nice."
American amateur Bryson DeChambeau finished alongside McIlroy after adding a 72 to his opening 64, with world number five Henrik Stenson part of a seven-strong group on seven under.
Rickie Fowler's finish was not quite as spectacular as that of playing partner McIlroy, although the world number six did clatter the flag with his approach to the 16th and also birdied the 18th to finish six under.
In contrast, the final member of the group, world number one Jordan Spieth cut a frustrated figure as he finished with five straight pars to card a 73 and finish three under.
Rory McIlroy is two shots off the lead after a spectacular finish to his second round at the Abu Dhabi HSBC Championship on Saturday.