Inverness leapfrogged fellow strugglers Ayr in the cinch Championship table after a 3-1 victory at Somerset Park.
The visitors went ahead in the 29th minute when Billy Mckay took advantage of a defensive error to net his ninth goal of the season.
Inverness made sure of the points early in the second half as Morgan Boyes scored twice in the space of eight minutes.
Ayr pulled a goal back in the 65th minute when Logan Chalmers lashed home, while Cameron Harper hit the crossbar for Inverness late on.