United weathered relentless pressure in the second half after 17-year-old Ryan Gauld netted his first senior goal in the 24th minute.
The visitors held out until the third minute of added time, when Liam Craig was left unmarked to head home a corner and deny McNamara's side a place in the top six.
"You think it is going to be your night, you think you are going to win but you have to see it out," said McNamara. "We defended well at times when they put us under pressure."
United's cause was not helped by the 78th-minute dismissal of Stuart Armstrong, who was adjudged to have dived by referee Iain Brines and incurred a second booking.
"The sending-off gave them the lift they needed," McNamara added. "We stopped passing the ball and we got caught in a scrappy game.
"I don't know if there was contact or not. I haven't asked Stuart yet. Buy you are looking for consistency.
"The lad who scores their goal, runs off the park into the crowd, and he had been booked, and nothing happens.
"Not that we could make too much of it in the last seconds but a lot of decisions there didn't go both ways."