Cove Rangers looked set to let a two-goal lead slip for the second week in a row before Declan Glass secured the points against Cowdenbeath with a stunning stoppage-time winner.
Jamie Masson had fired the hosts into the lead after 17 minutes before on-loan Dundee United midfielder Glass doubled the advantage.
But the Blue Brazil battled to square the game through a Fraser Mullen penalty and a crisp David Cox drive before Glass grabbed the winner.
The victory capped a pleasing day for Cove, having confirmed the signing of former Aberdeen, Wigan and Dundee United midfielder Fraser Fyvie on a deal until January before kick-off. The 26-year-old played the full 90 minutes for the hosts.
Cove manager Paul Hartley said: “We were so far ahead and controlled most of the game, we just had to manage it better.
“We lacked concentration and discipline a little bit but I think we deserved three points and we could have scored more.
“Declan Glass is a special talent. Sometimes you need a little bit of quality, a bit of magic to win you a game. He did that and he’s been terrific so far.
“I thought Fraser Fyvie, with all his experience, was great.”
Cove took the lead in the 17th minute when Harry Milne fed Masson and the former Formartine United and Aberdeen midfielder showed great composure to beat a man and despatch the ball low past Kevin Dabrowski from 12 yards.
Milne found the back of the net shortly after but the left-back was adjudged to have used an arm to control the ball before clipping home.
Cove captain Mitch Megginson was replaced just after the half-hour mark after suffering a dead leg. He was replaced by Matthew Smith.
Cove had a penalty appeal after 33 minutes when Milne tumbled in the area following a Fraser Mullen challenge but, instead of pointing to the spot, referee Colin Steven showed the defender a yellow card for diving.
Ten minutes from the break Cove enjoyed a let-off when Blue Brazil striker Connor Smith saw his six-yard side-foot shot come back off the base of the post with Stuart McKenzie beaten.
Ten minutes after the break Cove should have doubled their advantage but, from eight yards out, Glass shot weakly past the upright.
Cove got their second goal on the hour with a superb piece of play from Glass which culminated in his 15-yard shot fizzing into the roof of the net.
The game looked over but Cowdenbeath had other ideas.
They were awarded a penalty after 68 minutes when Connor Scully brought down Archie Thomas and Mullen sent McKenzie the wrong way from the spot.
Cowdenbeath drew level in the 78th minute when Cox blasted the ball past McKenzie.
But Cove weren’t willing to settle for a share of the spoils and Glass netted a wonderful winner from 20 yards in the first minute of stoppage time.
COVE RANGERS (4-4-1-1) – McKenzie 6, Milne 7, Scully 7, Strachan 7, Yule 7, Megginson 5 (Smith 31), Masson 7, Higgins 7, Glass 9, Antoniazzi 6 (Robertson 69), Fyvie 7. Substitutes not used: Kelly, Ross, Redman, Brown, Demus
COWDENBEATH (4-4-2) – Dabrowski 7, Hamilton 6, Mullen 7, Todd 6, Barr 7, Miller 6, Cox 6, Buchanan 6, Smith 7, Thomas 6, Renton 6. Substitutes not used: Valentine, Herd, Connolly, Taylor, Whyte, Glass, Sneddon
Referee – Colin Steven 5
Attendance – 880
Man of match – Declan Glass