The ex-Wrexham boss previously managed the Minstermen from October 2010 to March 2013 and led them to promotion from the Conference to League Two in 2012, as well as winning the Football League Trophy in the same season.
Mills replaces McNamara, who stepped down as permanent manager on Monday but remained in a caretaker role with the team sitting in 19th place with 13 points from 15 matches.
The Scotsman, however, remains employed by the club, and will now be working alongside chairman Jason McGill in a senior role.
"Jackie will focus on all operational aspects of the club with specific attention paid to the development of a communication strategy, effective both internally and externally, administration management, aspects of the academy, aspects of the foundation and commerciality to name just a few of the areas of his involvement," the club said in a statement.
"When required by the first-team manager, assistance will also be provided by the chairman and chief executive, especially in relation to certain financial aspects of the playing budget. It is imperative that we support the first-team manager by taking away the non-playing issues so he can focus on results."
Mills's first game back in charge is Monday's FA Cup fourth qualifying-round replay at Curzon Ashton.