Ayr adopted a shoot-on-sight policy and were rewarded when Brian Gilmour launched an effort from near the halfway line after 17 minutes which beat Ryan Scully and dipped under the crossbar. An under-hit passback from Ryan Williamson allowed Michael Moffat to double Ayr's advantage 10 minutes later.
However, Stephen Husband pulled one back before half-time and Ryan Wallace equalised from the penalty spot on the hour. Wallace scored again nine minutes later and Jordan Moore added a fourth for the Fifers in injury time.
East Fife inflicted an eighth successive defeat on Airdrieonians when they won 3-1 in Lanarkshire. Lewis Coult gave Airdrie the lead but East Fife levelled before half-time when Lewis Barr's effort went in off Gregor Buchanan for an own goal. Ross Brown put the visitors in front after 70 minutes and Stephen Hughes added their third.
Jamie Longworth netted his 18th goal of the season as Stranraer beat Brechin City 3-0 at Stair Park. Martin Grehan and Grant Gallagher added to the hosts' tally after Brechin's Darren Petrie was red-carded four minutes into the second half.
Michael Travis hit an 84th-minute equaliser as Arbroath drew 1-1 away to Forfar Athletic. Paul McManus had put Forfar ahead just after the break. Arbroath's Graham Bayne was sent off four minutes from the end.