Inverness had been hoping to clinch a place in next season's Europa League with a victory over the Terrors.
But after taking the lead through Aaron Doran, having earlier seen Billy McKay miss a penalty, Ryan Dow levelled matters early in the second half and Mackay-Steven fired home the second in the 90th minute for a 2-1 win.
And, despite having less to play for than the hosts, McNamara admitted: "It was pride. As a footballer, you come here and you try to enjoy it and try to get the three points as much as them.
"It's a much better feeling at the weekend when you win."
United were also boosted by the sight of Johnny Russell making his first start in two and half months since breaking his leg.
McNamara added: "It was good to see him. You can see that he's still not quite there. He's a wee bit sore but for me it was good to have him out there."