The Tannadice team went 2-0 up in the first half through Stuart Armstrong and Gary Mackay-Steven before a Stevie Smith free kick brought Rangers back into the tie.
But then, as the game ebbed and flowed, stand-in goalkeeper Steve Simonsen made a horrendous gaffe from a pass back and gifted the clinching goal to Nadir Ciftci with less than 10 minutes to go.
The result will ratchet up the pressure on Ally McCoist after last weekend's disappointing loss to Raith Rovers in the Ramsdens Cup final.
Simonsen, the Glasgow club's 35-year-old English keeper was called into action for only the second time this season after Cammy Bell suffered concussion, but it was to prove a nightmare semi-final outing.
There had been little between the sides up until that point, with United clinging to their slender lead.
After a positive start from Ally McCoist's Rangers - who had been heavily criticised for losing the Ramsdens Cup final to Raith Rovers at Easter Road last week - goals from midfielder Stuart Armstrong and wide-man Gary Mackay-Steven put the Taysiders two ahead before Light Blues defender Steven Smith pulled one back before the interval with a free-kick.
After the break the Govan men could not fashion anything like the two chances missed by Dean Shiels and Jon Daly in the first half, and when Simonsen's hesitancy allowed Ciftci to pounce it was all over.
Jackie McNamara's team will play the winners of Sunday's semi-final between St Johnstone and Aberdeen in the final at Celtic Park on May 17.
Ibrox was like a bear-pit at kick-off as the Rangers support, outnumbering their United counterparts, roared their team forward.
Fraser Aird's corner from the left in the fourth minute was met by Rangers skipper Lee McCulloch but his header was blocked by the sheer numbers inside the United box, as was Bilel Mohsni's effort, before the Tayside team got the ball to safety.
In the 14th minute Aird let fly from the edge of the box after using Smith as a decoy but his drive hit the side-netting as United goalkeeper Radoslaw Cierzniak scrambled across his goal to cover.
Five minutes later Shiels missed a great chance when he was sent clear by Aird with the Northern Irishman dragging his shot well wide of the target with only Cierzniak to beat.
The Govan side were made to pay for that missed opportunity four minutes later when, having failed to clear a free-kick, United defender Gavin Gunning headed back into the Rangers box where Armstrong knocked his shot past Simonsen and in off the post.
It looked like the presence of Ciftci in an offside position had put the Rangers defence off but the United forward almost made a more material impact moments later when his drive had to be parried clear by Simonsen.
The Ibrox men rallied and midfielder Nicky Law's cross struck the crossbar before a goalmouth melee ended with United still having their goal intact.
Daly was next to miss a great chance for the Govan side when Ian Black's pass was knocked down by Aird leaving the Irishman with only Cierzniak to beat, but he curled his left-footed shot high and wide, as United claimed for offside.
A minute or so later United were two ahead after slackness in defence by Foster saw him robbed of the ball. It eventually arrived at Mackay-Steven whose shot looped over Simonsen and into the net.
It looked a long way back for Rangers but they were given hope in the 42nd minute when Cierzniak let Smith's free-kick from 25 yards slip through his hands and the ball sneaked in at the corner.
There was more drama before the interval as United appealed for a penalty when Ciftci went down in the box under a challenge by Mohsni, aided by Simonsen, but referee Bobby Madden was unimpressed.
Everyone inside Ibrox gathered their breath at the interval but the cup tie resumed at breakneck pace.
Five minutes after the break Armstrong outpaced the Gers defence and beat the hesitant Simonsen to the ball but lofted it over the bar.
Nicky Clark replaced Aird in the 63rd minute as McCoist tried another way back to level-pegging but United looked more assured than they had in the first period.
Chances had dried up at either end although Cierzniak made a decent save from Smith's deflected free-kick.
But with seven minutes remaining the Tannadice side were gifted the goal which confirmed their place in next month's final.
Foster raced back under pressure from Ciftci and knocked the ball back to Simonsen who took a touch that proved far too heavy. It saw him dispossessed by the United striker who was celebrating along with the travelling army of Tangerines supporters even before tucking the ball into the empty net.