In a game starved of clear-cut opportunities, particularly in the second half, McNair's leveller with eight minutes remaining cancelled out Sean Morrison's 37th-minute opener for Cardiff.
McCarthy's unbeaten start to life at the Welsh club was extended to nine matches, but that was not enough to climb back into the play-off places and they dropped to eighth.
Middlesbrough boss Neil Warnock, who left Cardiff after three years in November 2019, will be slightly happier his men prevented a fifth defeat from six matches at home with McNair's goal.
Unchanged Cardiff's fine form under McCarthy must have filled them with plenty of confidence going to the north-east. But ninth-placed Middlesbrough, struggling of late, had the better of the first-half chances until the opener went in.
In fact, once Middlesbrough goalkeeper Marcus Bettinelli had got down to his left to make a strong save from Will Vaulks' early free-kick, Cardiff spent much of the opening period on the back foot.
While Anfernee Dijksteel did a fantastic job in following Cardiff's dangerous Josh Murphy everywhere, the men in red found space easier to find at the other end.
Once McNair had drilled a free-kick from the edge of the box just wide after Marcus Tavernier was tripped by Morrison, Middlesbrough could count themselves unlucky not to be ahead.
Cardiff goalkeeper Dillon Phillips, by rushing out to beat Britt Assombalonga to a couple of poor back passes, spared Vaulks' blushes twice.
Those were before Phillips had to be equal to an Assombalonga shot towards his bottom corner after Jonny Howson's threaded pass in behind the defence, while Dael Fry headed a cross wide.
But Vaulks, moments after he was cautioned for a late tackle on Tavernier, turned provider at the right end with eight minutes remaining of the opening half.
His long throw dropped into a crowded area and Morrison managed to flick his header inside Bettinelli's far post to edge Cardiff in front.
After the restart, Cardiff were happy to soak up plenty of pressure and prevented Middlesbrough from really testing Phillips again.
In fact, there was a lack of chances at both ends, with neither side showing the sort of creativity required to unlock the defences.
In a bid to make things happen, Warnock brought on Marvin Johnson and Neeskens Kebano for the final 20 minutes. Chuba Akpom and Djed Spence followed 10 minutes later.
Those attacking changes had the desired effect. Kebano's cross was not dealt with by ex-Middlesbrough defender Aden Flint and, when his clearance hit Tavernier, Akpom's header towards goal was finished off by McNair.
There was also a late penalty shout when Akpom's drive struck Marlon Pack in the arm, but those were waved away and the game ended level.
Support The Yorkshire Post and become a subscriber today. Your subscription will help us to continue to bring quality news to the people of Yorkshire. In return, you'll see fewer ads on site, get free access to our app and receive exclusive members-only offers. Click HERE to subscribe.