THE New Saints won an eight-goal thriller at Treflan to qualify for the quarter-finals as winners of Group B and set-up a home tie with Caernarfon or Porthmadog.
The hosts raced into a 7th-minute lead thanks to John Toner, but despite total domination of the first-half, any thoughts of an easy passage were banished after Chris Williams levelled from a free-kick on the stroke of half-time.
Nomads' keeper Paul Smith had kept his side in the game with some fine saves and when Williams' set-piece hit the wall, he smashed the rebound past Gerard Doherty.
Twice more TNS took the lead only to be pegged back. Alfie Carter set-up Barry Hogan for a rare goal in the 53rd minute, but Chris Sergeant ran through the Saints' defence to equalise four minutes later.
Carter's byline cross provided an opening for Michael Wilde to smash home from six yards, but Quay replied quickly again, Adam Dickinson's shot taking a wicked deflection to loop over Doherty.
TNS wobbled as Doherty was forced to save a header and Sergeant fired over unmarked in front of goal. But former TNS defender Chris Taylor steadied the ship for his former club, conceding a penalty by bringing down Carter for Nicky Ward to make it 4-3.
And Toner's burst down the right ended with a cross for Carter to put the result beyond doubt.
Report and stats courtesy of welsh-premier.com