Inverness moved level on points with third-placed opponents Ayr as Cameron Harper’s goal snatched a 1-0 win.
Ayr enjoyed the better of the first half, with Andy Murdoch firing narrowly wide in the early stages and Mark McKenzie seeing a headed effort come back off the crossbar.
Josh Mullin had a shot saved in the 23rd minute and McKenzie was not too far away with another strike before the break.
The home side were made to pay for their profligacy at the start of the second half as Cameron Harper headed Inverness in front.
Ayr substitute Jayden Mitchell-Lawson curled inches wide shortly after coming on but that was the closest they came as Inverness held on.
Subscribe or register today to discover more from DonegalLive.ie
Buy the e-paper of the Donegal Democrat, Donegal People's Press, Donegal Post and Inish Times here for instant access to Donegal's premier news titles.
Keep up with the latest news from Donegal with our daily newsletter featuring the most important stories of the day delivered to your inbox every evening at 5pm.