Billy McKay fired Inverness CT into the fourth round of League Cup at Dundee's expense.
McKay, who has been in superb form this season, rifled home from eight yards following a slick passing move.
And Inverness came close to doubling their lead soon after, Nick Ross's shot coming back off the post.
Craig Beattie's effort was the closest John Brown's men came to an equaliser as the Premiership leaders progressed.
Inverness started brightly at Dens Park and McKay opened the scoring in trademark style, finding the net past the helpless Kyle Letheren.
The striker then pressed for his and Inverness's second but his effort was deflected over and Ross spurned a good chance.
Jim McAlister and Beattie had shots deflected wide as Dundee tried to force their way back into the game and Beattie forced Danny Brill into a good save before the break.
McKay was denied by the woodwork for a second time, when he hooked Foran's cross over his head from 15 yards only to see it loop off the bar.
Peter MacDonald then saw a powerful shot pushed over by Brill before curling a 25-yard free-kick just wide.
Dundee continued to pin Inverness back but they struggled to break down a resilient defence which has now kept five clean sheets in eight games this season.
And Brill ensured Inverness would progress in 90 minutes when he dived low to his left to keep out Ryan Conroy's shot after clever work by MacDonald.
Dundee manager John Brown: "We did everything bar put the ball into the net. Their goalkeeper is well named because he was 'brill' tonight.
"He made a great save from Craig Beattie. I felt we were the better team over the 90 minutes but that's cup football; we didn't take our chances.
"I think Terry has done a great job at Inverness. They are flying high in the Premier League.
"We've got to get out of this division. This game shows us that we can compete at a high level. We've got to do it week in, week out."
Inverness manager Terry Butcher: "The players have got to buy Dean Brill a big drink because he has kept us in the cup.
"The team that turned up tonight is not the team that got us to the top of the league and the players have been told that in no uncertain terms.
"I have actually given the players two days off to go away and think about it because when they come back in on Friday I want them really focused on Hibs because if we play like that against Hibs we will get turned over.
"Fair play to Dundee, it was a great performance from them. They are the ones who deserve to go through, not us.
"They caused us problems, we didn't do well enough in possession or out of possession. They bossed the game in every department."