He was educated by the Irish Christian Brothers at St Mary's College, Crosby. He studied for an LLB at the University of Hull. He was head of department in History at St Mary's Grammar School (now called St Mary's College  ) in Hull from 1958–64 and a Law lecturer at Hull College of Commerce from 1964–66.
After unsuccessfully contesting Bridlington in 1964, McNamara was elected to the House of Commons as Member of Parliament (MP) for Hull North, in a by-election in January 1966 following the death of sitting Labour MP Henry Solomons. Labour's hold of a former marginal seat with a significantly increased majority is widely considered to have helped to convince the Prime Minister Harold Wilson to call the 1966 election to seek a larger majority.
McNamara retained his seat at the 1966 general election, and at subsequent elections until the constituency was abolished for the February 1974 general election, when he transferred to the new Hull Central constituency. When that constituency was abolished for the 1983 election, McNamara was re-elected for the re-created Hull North constituency.
McNamara campaigned in his last years in parliament on many issues, protesting against the Act of Succession which prohibits a Roman Catholic or the spouse of a Roman Catholic to be the British monarch. He stepped down at the 2005 general election, with the local Constituency Labour Party choosing Diana Johnson to stand in his place.
During the 2005 general election campaign McNamara claimed some of the policies regarding illegal travellers' sites of the leader of the Conservative Party, Michael Howard had "whiff of the gas chambers" about them. Howard's grandmother died at Auschwitz.
McNamara was known throughout his parliamentary career as a supporter of Irish nationalism who favoured a United Ireland. After entering parliament, he soon became interested in reports of discrimination against the Catholic minority in Northern Ireland and supported the Campaign for Democracy in Ulster (CDU). He served as a frontbench spokesman for the Labour Party, including Shadow Secretary of State for Northern Ireland under Neil Kinnock, 1987–94, an appointment that was widely criticised by Unionists.
After Tony Blair became Labour leader, he replaced McNamara as Northern Ireland spokesman with Mo Mowlam. In 1997, he helped persuade the newly elected Labour government to donate £5,000 (thereby matching the contribution of the Irish government) for the erection of a memorial in Liverpool to the victims of the Great Irish Famine.
Personal and later life
In 2006, McNamara received the honorary degree of Doctor of Laws from Hull University in recognition of his long service in politics. He graduated with a PhD from the University of Liverpool in 2007 having completed a thesis on the MacBride Principles at the Institute of Irish Studies  , where he gave the 2008 John Kennedy Lecture in Irish Studies, Perhaps It will all go away – An examination of the British Response to the Civil Rights movement in Northern Ireland.