Ange Postecoglou's side were cruising against a lacklustre United with Dominic Solanke's double and a goal for Dejan Kulusevski putting them 3-0 up after 54 minutes.
But the home crowd were left chewing their fingernails as two terrible mistakes by their keeper Fraser Forster allowed substitutes Joshua Zirkzee and Amad Diallo to give United hope.
There were still 20 minutes left when Diallo made it 3-2 and United were close to equalising on several occasions before Son Heung-min appeared to have sealed it in odd fashion, deceiving United keeper Altay Bayindir directly from a corner.
There was still time for Jonny Evans to head a third for United in stoppage time but a relieved Tottenham hung on to secure a two-legged semi-final against holders Liverpool.
Arsenal face Newcastle United in the other semi-final.
"Being 3-0 up we could have dealt with the game better, killed some time but we made it hard for ourselves, but the important thing is we won and we're through," Solanke said.
"That's football, we stick together. Mistakes are a part of football, we dug in, we showed spirit and got the job done."
Postecoglou's side let a 2-0 lead slip to lose 4-3 at home to Chelsea in their last home game and for a while it looked as though their innate ability to shoot themselves in the foot was coming back to bite them.
This time, however, the fans went home happy and Postecoglou moves a step closer to making good on his reputation for securing silverware in his second season at clubs and delivering a first cup for Spurs since they won the League Cup in 2008.
Tottenham are at full stretch because of injuries but still dominated Ruben Amorim's side which showed five changes to the starting lineup that stunned Manchester City on Sunday but still had no place for want-away forward Marcus Rashford.
Solanke put the hosts in front in the 15th minute when Bayindir fumbled a well-hit shot by Pedro Porro and the striker fired in the rebound off the post.
Bruno Fernandes had a couple of efforts and Rasmus Hojlund volleyed wide but Tottenham were comfortable and in cruise control straight after the interval when Lisandro Martinez could only turn a James Maddison cut-back into the path of Kulusevski who made no mistake.
Solanke was then allowed to dribble across the area before sliding a shot inside the post in the 54th minute and the tie looked over as a contest.
But Forster then played a casual pass out of his area and Fernandes intercepted and the ball reached Zirkzee to tap in.
Forster then compounded that error by taking an age to make a routine clearance and Diallo slid in to charge down his kick and divert the ball into the net.
Tottenham looked a bundle of nerves as United swept forward but captain Son restored calm with an inswinging corner that went over the head of Bayindir to ripple the net.
Substitute Evans' riposte came too late to save United who will regret the way they started the tie.