Frankie Musonda scored a second-half header against former club Raith as Ayr edged a 1-0 cinch Championship win to move into the play-off places with one match remaining.
Raith had the better of the first-half possession but were unable to break the deadlock, with Sam Stanton’s long-range effort missing the top-right corner before Connor McBride had a chance blocked.
Paddy Reading was just inches wide as Ayr looked to open the scoring early on, while Sam Ashford hit a post midway through the first half, which ended goalless.
The hosts were fastest out of the blocks as the second half got under way and Zambia defender Musonda put his side in front as he headed Sean McGinty’s cross into the top corner following a free-kick.
The win moved Ayr up to fourth.