Martyn Fotheringham scored an 89th-minute winner as Forfar won 3-2 at Ayr.
The hosts were searching for their first league victory of the season, and took the lead just six minutes into the game when David Sinclair found the top corner from the edge of the area.
Iain Campbell's penalty pegged Mark Roberts' men back in first-half stoppage time after John Robertson had impeded Christopher Templeman inside the box.
The Honest Men went ahead for the second time after 52 minutes when Sinclair sent a 20-yard free-kick past Loons' goalkeeper Derek Soutar.
Ross Campbell set Gavin Swankie through seven minutes later, and Forfar's top goalscorer made no mistake to bag his fourth goal of the campaign.
The match looked to be heading for a draw, before Fotheringham got on the end of Swankie's assist and found the bottom corner with a cool right-footed strike.