Ryan Dow took advantage of a defensive blunder and add to Ryan Gauld opener, before Caley Thistle substitute Liam Polworth scored with a spectacular shot.
The result means United are chasing European football on two fronts, through their final league position and the Scottish Cup.
McNamara said: "I think on balance we just shaded it. When you go 2-0 up you are comfortable.
"But they never really gave us anything to worry about until their lad unleashed that great strike towards the end.
"It's a great three points. We worked really hard for the win. We showed a lot of desire and guts.
"Ryan Dow chased a lost cause for his goal and got the rewards for that. We showed a good mentality here. I don't think there were many weaknesses.
"It keeps that winning mentality going, that's eight wins in nine games."
Caley Thistle manager John Hughes felt his side had only themselves to blame for defeat at Tannadice.
Hughes said: "We've given the game away - that's for sure. That goes for the two goals.
"Our keeper (Dean Brill) apologised to the lads in the dressing room afterwards for the second goal. But that's the kind of guy he is.
"He trains like a world champion and has been outstanding since I came to the club. He's a fantastic character and has great spirit. He has kept us in plenty of games.
"I wouldn't like to think any of our players have downed tools for the season. We've still got plenty of cup finals to play."