Niall (d. 1061), son of Máel-Sechnaill and king of Ailech, was a member of the Northern Uí Néill dynasty of Cenél nÉogain. His father, Máel-Sechnaill son of Máel-ruanaid styled rígdamna (eligible for the kingship) of Ailech, died in 997. He had at least one brother, Lochlainn, who was most likely the grandfather of the illustrious Domnall Ua Lochlainn (qv) and ancestor of the ruling line of Mac Lochlainn. There is no record of Niall's wife, but he had at least three sons, Domnall, Áed, and Donnchad. Niall's immediate predecessors in the kingship of Ailech were very distant kinsmen: Flaithbertach Ua Néill (qv) (d. 1036) and his son Áed, who interrupted his reign. In Niall's direct line, his nearest relatives to have reigned as kings of Ailech were his great-great-grandfather, Domnall (d. 915) son of Áed Findliath (qv), and two great-granduncles – the second of whom, Fergal son of Domnall, died in 938.
Niall came to prominence in 1023 when, with the support of Cianachta Glinne Gaimen, he rebelled against his brother Lochlainn, then local king of Cenél nÉogain, and slew him in battle. He was unable to make a successful bid for the kingship of Ailech while Flaithbertach Ua Néill was alive, but the latter's death (1036) created an opportunity to seize the higher regnal dignity. As king of Ailech, Niall defended the rights of the community of Armagh and enforced the lordship of the Northern Uí Néill within Leth Cuinn (the northern half of Ireland). In 1044 the profanation of St Patrick's ‘Bell of the Testament’ provided justification for a punitive raid by Niall on the territories of Uí Méith and Cuailnge (south-west Armagh, north Louth). In 1047 he made a punitive attack on the kingdom of Brega, and in 1056 he invaded Dál nAraide, taking 2,000 cattle and sixty hostages.
Niall died in 1061, apparently of natural causes. His immediate successors in the kingship of Ailech were his nephew Ardgar (d. 1064) son of Lochlainn, and a distant cousin, Áed (d. 1067) grandson of Ualgarg. Niall's sons Domnall (d. 1068), Áed (d. 1083), and Donnchad (d. 1084) each succeeded to the kingship in turn, but the later family line was not politically important.