Cupar Hearts made the difficult journey to Lumphinnans United last Saturday and continued their run of form with a battling performance to pick up all three points.
A horrendous goalkeeping error saw Hearts go behind when Ian Rann lost the ball allowing Darren Seath to walk into the net.
Cupar equalised four minutes later from a Scott McKay throw which was knocked on by Lee Sibanda for Kyle Watson to score from close range.
Early in the second half a superb save by Ian Rann saw him get his fingertips to a Callum Whisker shot and Hearts were quick to break.
A great run by Scott Mckay set up Lee Sibanda who skipped passed two defenders.
His shot was blocked off the line but Kyle Watson was on hand to fire in the rebound.
Then moments later Cupar once again shot themselves in the foot when Ian Rann picked up a pass back and the referee awarded a free kick. Lumphinnans’ Gavin Reilly stepped up and powered his kick through the wall and into the net.
Hearts regrouped and took the lead on the hour mark in spectacular fashion when Aaron Leadbetter picked his spot and scored with a sensational left-footed strike from distance.
The game was far but over though and Cupar gifted the home side yet another equaliser when a defensive mistake allowed Gavin Reilly to grab his second.
With seven minutes remaining Scott McKay thumped home the winner.
Scott McInroy led the way in the dying minutes with two goal line clearances.
Tomorrow (Saturday) Cupar Hearts host Largs Thistle at the Duffus Park, in the third round of the Scottish Cup. Kick off 2.00pm.
Cupar Hearts - Rann, Wainwright, McInroy, Leadbetter, Calcutt, McGuire, K. Brown, McKay, Sutherland, Sibanda and Watson.
Subs - Gray, Dobes, Blyth, McLuckie and G Brown.