McIlroy began the last day two shots behind playing partner Gallacher but was 2-over after 10 holes before the first birdie of his round at the 11th.
The Northern Irishman then bogeyed the 12th and 13th before only his second birdie of the round at No. 17.
"On the rare occasions I got the ball close, I didn't make any putts, so it was one of those days," McIlroy said. "I thought if I could get to 16 under it would be good enough and it turned out that it was as that's what Stephen got to. I just wasn't able to play well enough to get there. It was just one of those days. Anything that could go wrong, did."