Alexander Mackay was born in Edinburgh, Scotland, probably on 11 May 1833. His father was Alexander Mackay, a lawyer; his mother's name is unknown. At the age of five he left Scotland to attend school at Southsea, in England. In 1844 he sailed on the Slains Castle with his uncle, James Mackay, for Nelson, New Zealand, arriving in January 1845. During the next 19 years Alexander Mackay was engaged in farming in the Nelson province. Although details of his life during this period are rather sketchy, he is known to have been a student of Māori culture and became proficient in the Māori language.
In February 1859 the Nelson provincial government asked James Mackay junior, a son of James Mackay, to attempt to find a more direct route to the West Coast than that previously discovered by Thomas Brunner. He combined this with his official duty of negotiating the purchase of the West Coast from Poutini Ngāi Tahu. Alexander Mackay accompanied his cousin on the journey, and although James failed in his efforts to acquire land from the Māori, he and Alexander continued on an exploration of the Grey River until a shortage of provisions drove Alexander back to Nelson.
In 1860 Alexander Mackay accompanied his cousin and uncle on another expedition to the West Coast. The former intended to complete the purchase of land from Poutini Ngāi Tahu, and to attempt to find a new route to the Grey valley. With Julius Haast and James Burnett, they spent three weeks identifying road lines in the Rotoiti district. When the expedition resumed, it travelled up the Maruia River, then turned south towards the headwaters of the Grey. This proved to be the desired new route, but because of a shortage of provisions Alexander Mackay turned back before his cousin arrived on the coast in March 1860.
By the early 1860s Alexander Mackay seems to have attained a respectable position in Nelson society. He married Hannah Sarah Gibbs at Collingwood on 23 May 1863; they were to have at least six children. Hannah's father, William Gibbs, was a member of the Nelson Provincial Council, and had been a resident magistrate and goldfields warden.
In 1864 Mackay was appointed resident magistrate and commissioner of native reserves in the South Island. He no doubt gained this latter appointment because of his familiarity with Māori language and culture. He appears to have administered the reserves efficiently and in a way which earned him the approbation of the Māori. He used the knowledge gained in this position to compile, in 1871, the voluminous Compendium of official documents relative to native affairs in the South Island. Mackay was appointed native reserves commissioner in New Zealand in 1882 and a judge of the Native Land Court in 1884. Poutini Ngāi Tahu petitioned for him to be returned to his previous position. Mackay had also served as a trust commissioner for the district of Wellington under the terms of the Native Lands Frauds Prevention Act 1870.
In 1886, as a result of persistent protest by Ngāi Tahu that the promises made when they had alienated their land to the Crown had not been fulfilled, Mackay was appointed a commissioner to inquire into the claims of landless Māori in the South Island. After a detailed examination of the question and a tour of Ngāi Tahu settlements, Mackay reported that fundamental principles had been breached in the purchase of land from Ngāi Tahu: insufficient land had been reserved for Māori and no compensation had been paid for the loss of hunting and fishing rights, which had been among their principal means of subsistence. Mackay recommended that substantial areas of land be set aside both for endowment purposes and for the immediate use of poverty-stricken Ngāi Tahu. It was a tragedy for Ngāi Tahu that his thoughtful and constructive report was not implemented.
Mackay conducted a further investigation in 1890–91, when he reported that 90 per cent of Ngāi Tahu possessed insufficient land to obtain a livelihood. The tribe, Mackay added, had also been hard hit by unemployment, damage to their fisheries caused by drainage, and the fragmentation of holdings – factors which greatly exacerbated the fundamental problem of landlessness.
In 1893 the government instructed Mackay and the surveyor general, Percy Smith, to apportion selected Crown lands, at a rate of 50 acres per head, to landless Ngāi Tahu. The land eventually allocated was situated in remote areas, such as Fiordland and Stewart Island, and was chosen without reference to Māori. The scheme bore no resemblance to Mackay's 1886 proposals. By 1905, working largely in their own time and devoid of resources, Smith and Mackay completed the enormous task of listing all the landless Māori in the South Island and apportioning them their allotments. This, however, proved to be a fruitless exercise, as almost all the land was either so remote or of such poor quality as to be virtually useless.
Alexander Mackay retired as a Native Land Court judge in 1902, and moved to Feilding. Premier Richard Seddon paid tribute to his 'long and honourable official career', and praised his services to future historians of New Zealand. Mackay died at Feilding on 18 November 1909; Hannah Mackay died there on 11 July 1926.