Ayr scored twice late on to claim a 2-1 victory which leaves East Fife still deep in trouble at the wrong end of the Second Division table.
The second-bottom Fifers are now winless in nine league games and have lost five of their last six but do remain just two points adrift of Stranraer.
They took the lead after just 15 minutes when Scott Durie converted Robert Barr's left-wing cross with a well-taken finish from 12 yards.
And that was the way it remained until the 79th minute, Liam Buchanan latching on to David Winters' cross to convert low past Michael Brown for the leveller.
Ayr then completed the turnaround with just three minutes remaining on the clock when Brown parried Buchanan's long-range effort and Winters was on hand to convert.