Newtown scored a last-gasp winner at Gap Connah's Quay to move into sixth place in the Welsh Premier League and leave their only rivals, Carmarthen, needing a win at TNS next week to deny them a place in the Championship Conference.
The Nomads led twice, on-loan TNS wingman Ryan Fraughan firing them ahead for the first time in the 34th-minute.
A fine individual goal from Jason Oswell levelled matters nine minutes after the break, but the hosts were in front again on 64 minutes through a Jack Rowlands tap-in.
The Robins hit back again on 72 minutes when Luke Boundford seized on a clearance to score and Tom Goodwin grabbed the winner in the third and last minute stoppage time.
Caersws made easy work of their Central Wales FA Cup clash, winning 7-1 at Builth while Llanidloes continued their winning run beating Rhayader 3-0 with goals from Jamie Breese and Karl Seliarts.
Welsh Premier League
Gap Connah's Quay 2 Newtown 3
Huws Gray Alliance
Llanidloes 3 Rhayader O
Spar Mid Wales Legue
Division 1
Aberaeron 3 Montgomery 3
Aberystwyth Uni 0 Llanrhaeadr 6
Bow Street 0 Carno 2
Llansantffraid Village 0 Llanfair Utd 4
Penrhyncoch 3 Waterloo 1
Tywyn Bryncrug 0 Berriew 0
Welshpool 7 Machynlleth 2
Division 2
Borth Utd 0 Knighton 3
Newbridge-on-Wye 1 Abermule 7
Dyffryn Banw 2 Hay St Mary’s 6
Kerry3v Talgarth 1
Penybont 2 Bont 1
Presteigne 4 Churchstoke 3
CWFA Cup – Rd 3
Rhosgoch 0 Llandrindod Wells 4
CWFA Cup – Rd 4
Builth Wells 1 Caersws 7
Amateur League
Tanners Town Cup
Semi Final
Llanfair Res 3 Waterloo Colts 5
Waterloo Res 3 Newtown Wands 2
Llansantffraid Village Cup
Berriew Res 3 Four Crosses Res 2
Honda Division 1
AbermuleRes 5 Llanfyllin 1
Meifod 1 CaerswsRes
Mitsubishi Division
Forden Utd 2 Maesyrhandir 5
Llanymynech 2 Welshpool Res 2
Morda Utd 1 Llansantffraid Res 1