Match ends, Dundee United 1, Dundee 0.
A dramatic late header from Jaroslaw Fojut sent Dundee United into the League Cup quarter final at the expense of 10-man Dundee.
Radoslaw Cierniak denied Greg Stewart from the penalty spot and Dundee's despair deepened shortly afterwards when Martin Boyle was sent off.
Nadir Ciftci twice hit the crossbar as the depleted visitors clung on for 63 minutes with a man short.
But Fojut powered in to grab the winner from a stoppage-time corner.
Paul Hartley's men left the Tannadice pitch to a standing ovation from their support after battling bravely, but they could not exact revenge for Sunday's 4-1 defeat at Dens Park.
Instead, Dundee United have the derby spoils for the second time in four days.
In front of a full house, the game started at a frenetic pace, and it was the visitors who had the better opening.
Boyle nipped past Sean Dillion to get onto Paul McGinn's through ball and saw a shot deflected just wide, and from the corner Cierzniak did well to deny Luka Tankulic.
Dundee continued to be the more forward thinking side and they were given a gilt-edged chance to take the lead when referee Craig Thomson awarded them a penalty.
John Rankin took down Paul McGowan but Stewart saw goalkeeper Cierzniak guess right and his effort was pushed away.
If that was a blow to Hartley's men, it went from bad to worse when they were reduced in numbers.
McGowan lost possession and Stuart Armstrong raced forward on the counter-attack. Boyle knocked the midfielder over as he bore down on goal and the referee deemed it as a clear goalscoring opportunity.
Ciftci hit the bar with the resulting free-kick as the home side looked to take advantage.
United, inevitably with the extra man, started to look more dangerous and Ciftci again had an opportunity but directed a header just wide.
The Turkish striker was a man on a mission and again thundered a shot off the bar from a tight angle as United continued to chase the opening goal into the second half.
Armstrong then fired in a volley that was brilliantly tipped onto the post by Kyle Letheren before Simon Ferry had to head off the line as the pressure on the visitors increased.
The game was still alive for both teams though and Dundee raced forward through Stewart and Jim McAlister, before McGowan chipped the ball just over the crossbar.
Despite being a man down Dundee were finding energy from somewhere and James McPake was inches away from connecting with Philip Robert's cross with just five minutes left.
However, back came United and Dundee were heroically holding on until Fojut met Gary Mackay-Steven's late corner and bulleted a header into the net to spark wild scenes at Tannadice.
Dundee United manager Jackie McNamara: "We're relieved more than anything.
"With Dundee playing so long with 10 men it was a frustrating night all round, but I think you give them credit for the way they worked; they gave everything for Paul [Hartley] tonight.
"You think it's going to be one of those nights. We hit the woodwork a few times, had a couple cleared off the line. Jaroslaw actually had a couple of chances before he got the winner. I'm delighted for him because he's been excellent for us."
Dundee manager Paul Hartley: "I thought it was an outstanding game of football. It was end to end.
"We were outstanding for the first 30 minutes of the match, we controlled it, create chances - obviously there was the penalty miss.
"The sending-off sort of kills it for us and we'll have to look at that because I don't think that's a sending-off for me, I don't think there's any contact whatsoever. The referee made some strange decisions tonight."
- 8RankinBooked at 42minsSubstituted forBilateat 57'minutes
- 24SpittalSubstituted forErskineat 77'minutes
- 18DowSubstituted forMackay-Stevenat 54'minutes
- 2IrvineBooked at 72mins
- 23BoyleBooked at 27mins
- 21TankulicSubstituted forRobertsat 58'minutes
- Craig Thomson
- Shots on Target
Second Half ends, Dundee United 1, Dundee 0.
Goal! Dundee United 1, Dundee 0. Jaroslaw Fojut (Dundee United) header from the centre of the box to the top left corner. Assisted by Gary Mackay-Steven.
Corner, Dundee United. Conceded by James McPake.
Foul by Simon Ferry (Dundee).
Mario Bilate (Dundee United) wins a free kick in the defensive half.
Attempt missed. Chris Erskine (Dundee United) left footed shot from outside the box is close, but misses the top left corner.
Corner, Dundee. Conceded by Callum Morris.
Greg Stewart (Dundee) wins a free kick on the right wing.
Foul by Stuart Armstrong (Dundee United).
James McPake (Dundee) wins a free kick in the attacking half.
Foul by Mario Bilate (Dundee United).
Corner, Dundee. Conceded by Sean Dillon.
Paul McGinn (Dundee) wins a free kick on the left wing.
Foul by Gary Mackay-Steven (Dundee United).
Substitution, Dundee United. Chris Erskine replaces Blair Spittal.
Attempt blocked. Nadir Ciftci (Dundee United) right footed shot from outside the box is blocked.
Gary Irvine (Dundee) is shown the yellow card.
Foul by Gary Irvine (Dundee).
Gary Mackay-Steven (Dundee United) wins a free kick in the defensive half.