Both teams had numerous opportunities in what was a pulsating tie but it was the Dark Blues who struck late on with defender Lee Ashcroft netting the only goal of the game.
Dundee had the first half chance of the match in the 10th minute when Christie Elliott flashed a ball across the face of the Motherwell goal which was deflected wide for a corner.
The hosts had an even better opportunity when Jason Cummings was played in on goal but his low, angled shot was gathered at the second attempt by Motherwell goalkeeper Liam Kelly.
Kelly had to be alert once more when Dundee's Paul McMullan sprayed a pass into the feet of Elliott who was rampaging down the right in acres of space but his shot was comfortably dealt with.
The Steelmen finally tested home keeper Adam Legzdins in the 24th minute but Connor Shields' 20-yard drive was straight at the stopper who easily snuffed out the danger.
The same Motherwell player then spurned a gilt-edged chance as the striker smashed his shot off the crossbar after being set up by Steven Lawless.
It was Dundee's turn at the start of the second half to have their best chance of the game so far when McMullan teed up Jordan McGhee but Kelly made a superb save to deny the midfielder.
Shortly after, a long throw from the Motherwell left caused chaos in the Dundee defence with the ball falling for Shields but Legzdins managed to block his point-blank shot.
Dundee skipper Charlie Adam then tried his luck from long range with Kelly having to dive full length to his left to turn the ball away for a corner.
Dundee had the ball in the back of the net in the 58th minute but Cummings' effort was ruled offside.
The game was still balanced on a knife edge but the deadlock was finally broken in the 78th minute when McMullan swung a corner in from the left with centre-half Ashcroft powering a header past Kelly.
Motherwell tried valiantly to find an equaliser but there was no way back for the Steelmen.