Newcastle United Under-23s saw off their Derby County counterparts to secure a semi-final berth in the Premier League Cup.
The Magpies took a two-goal lead into half-time after an Owen Bailey header and a deflected effort from Matty Longstaff put them in control of the tie.
The Rams struck back after the interval and forced the tie into extra-time thanks to goals from Callum MacDonald and Josh Shonibare.
But Ben Dawson’s side would not be denied and Mo Sangare’s 95th minute strike eventually sent them through.
Both sides created chances in a lively opening spell to the game as Magpies full-back Ollie Walters brought a brave block out of visitors keeper Henrich Ravas and United stopper Nathan Harker dived full length to keep out an effort from Jayden Mitchell-Dawson.
But it was Dawson’s side that finally broke the deadlock on 39 minutes when captain Owen Bailey flicked a header past Ravas after getting on the end of a wonderful cross from the left by
Moments later Longstaff turned from creator to goalscorer as he ran on to a pass from Elias Sorensen and saw his low shot deflect off a visitors defender before nestling inside the far post.
The Rams got back into the game on 68 minutes when Calum MacDonald curled a 20-yard free-kick over the United wall and inside Harker’s right-hand post.
Within minutes Sorensen came within the width of the crossbar of restoring the Magpies’ two-goal advantage as his beat two defenders before hitting the top of the crossbar with a powerful shot.
The next goal was always going to be crucial and it fell the way of the visitors as substitute Josh Shonibare beat Harker to a high ball into the United area and headed the ball into the empty net.
That goal took the tie into extra-time and it was the young Magpies that struck early into the additional 30 minutes.
A foul on Ollie Walters by Rams defender Kellan Gordon saw United awarded a penalty and Sangare blasted home a rebound after Owen Bailey’s spot-kick was saved.
Substitute Adam Wilson came close to securing the win for the Magpies five minutes from the end of extra-time when he struck the crossbar with a powerful shot from the edge of the area.
However, United held on to see out time and secure their place in the last four of the competition.
Newcastle United U23s: Harker, Sterry, Walters, Cass, Watts, Bailey, Allan, Longstaff, Sorensen (Toure), Sangare (Young), Longelo (Wilson) Subs: Huuhtanen, Bartlett
Derby County U23s: Ravas, Gordon, MacDonald, Bird, Hunt, Buchanan, Mitchell-Laweson, Sibley (Roache), Cresswell (Anya), Babos, Whittaker (Shonibare) Subs: Yates, Wassall