The Tangerines got off to a flying start through Johnny Russell's second-minute opener before John McGlynn's visitors had Ryan Stevenson sent off for a foul on Gary Mackay-Steven midway through the first half.
Willo Flood made it 2-0 for McNamara's side on 62 minutes only for Michael Ngoo to pull one back for the Jambos in the 76th.
Despite their best efforts to force a late equaliser, it was the revitalised hosts who ran out winners with substitute Michael Gardyne sealing matters in the final minute.
Ten-man Aberdeen survived the dismissal of Mark Reynolds for two bookable offences to earn a share of the points from a 0-0 draw with St Mirren.
They had keeper Jamie Langfield to thank, however, for the fine save he made from St Mirren's in-form striker Esmael Goncalves in the dying stages, with the game teetering towards the Saints.
An early own goal from Stevie Hammell and a late headed second from William Gros gave Kilmarnock a 2-0 win and three points that they scarcely deserved against Motherwell.
Indeed it was fitting that Gros claimed the second which eased the home nerves as the Killie forward was responsible for three goal line clearances as the visitors bombarded Kyle Letheren's goal in the first half.
But Motherwell's frustrations got the better of them in the closing minutes when firstly Fraser Kerr and then captain Keith Lasley were shown straight red cards for wild tackles on James Dayton.
- Sports & Recreation
- Michael Gardyne
- Ryan Stevenson