Graham Hay's late header helped Brechin extend their unbeaten run to nine games with a win at Ayr.
The Hedgemen went into a 24th-minute lead when Ewan Moyes tapped in from close range after Andrew Jackson's header struck the cross bar.
Michael Donald had the chance to level 11 minutes later but he was unable to head Austin McCann's cross on target when well placed.
Donald made up for his profligacy five minutes into the second half when his left-wing cross picked out Liam Buchanan who swept home to equalise.
Michael Moffat scored all four of the Honest Men's goals at the weekend but it was McCann who came closest to completing the comeback with an audacious long-range strike which hit the bar.
It was Ray McKinnon's side who would have the final say, however, as Hay rose highest to nod in David McKenna's 75th-minute corner.
Ayr: Graeme Smith, John Robertson (Hunter 83), McGregor, Christopher Smith, McCann, Winters (McStay 77), Sinclair, Crawford (Roberts 86), Donald, Moffat, Buchanan. Subs Not Used: Brown, Brownlie.
Goals: Buchanan 50.
Brechin: Andrews, Paul McLean, Hay, Moyes (Murdoch 79), McLauchlan, Brown, McKenna (Cameron 85), Brady, Jonathan Stewart, Jackson, Ryan Stewart (Carcary 69). Subs Not Used: Nelson, Longridge.
Goals: Moyes 25, Hay 75.
Referee: Des Roache