McIlroy looked on course to claim his first professional win on home soil when he led by two shots with four holes to play at Royal County Down, just an hour from where he grew up.
But while Hojgaard completed a superb closing 65 with four birdies in the last five holes, McIlroy crucially bogeyed the 17th and then agonisingly missed an eagle putt on the 18th which would have forced a play-off.
McIlroy, who missed out on a first major since 2014 when he bogeyed three of the last four holes in the US Open in June, took a one-shot lead into the final round and made the ideal start with birdies on the first and second.
With playing partner Matteo Manassero then dropping shots on the third and fourth, McIlroy briefly enjoyed a four-shot lead before making a bogey on the seventh after failing to get up and down from left of the green.
McIlroy then missed from inside 10 feet for birdie on both the eighth and the ninth as Hojgaard kickstarted his challenge with an outrageous chip-in for birdie on the 10th.
Rory McIlroy was unable to take Hojgaard into extra holes in a nervy conclusion to the Irish Open. (AP PHOTO)
A birdie on the 11th edged McIlroy two in front again, but that advantage was wiped out as Hojgaard birdied the 16th and McIlroy bogeyed the 15th.
Hojgaard then dramatically holed out from a greenside bunker on the 17th and although McIlroy drew level with a birdie on the 16th, the four-time major winner charged his birdie putt on the 17th past the hole and missed the return.
Hojgaard's third birdie in a row on the 18th meant McIlroy needed to make an eagle on the same hole to force a play-off and a towering approach from 191 yards gave him a chance from 15 feet, only for the eagle putt to slide just wide.