Sean McGinty headed the winner as Ayr struck twice in three second-half minutes to beat Airdrie 2-1 at Somerset Park.
Irish defender McGinty anticipated a flick-on from a free-kick out wide and nodded home what proved to be the decisive goal five minutes after the interval.
Josh O’Connor had given Airdrie a half-time lead after racing clear of Ayr’s defence to smash an emphatic finish beyond goalkeeper Josh Clarke.
Ayr equalised two minutes after the restart when Anton Dowds darted on to Craig Watson’s weak headed back-pass to finish in style before McGinty headed in the home side’s second.
Airdrie’s Dean McMaster saw a spectacular volley brilliantly saved by Clarke in the first period, while Ayr’s appeals for a second-half penalty after Jamie Murphy went down in the box were waved away.