In 1660, Mackay was commissioned into Dumbarton's Regiment, spending the next few years in England and France, then volunteered to serve in the Venetian army during the Cretan War.
He returned to the Netherlands in October 1691 after the Treaty of Limerick and during the Nine Years War commanded the British division serving with the Allied army, and died at Steenkerque in 1692.
His original mission was to protect the Scottish Convention in Edinburgh; but on 12 March James landed in Ireland and John Graham, Viscount Dundee launched a rising in Scotland in his support.
Meanwhile, his eldest son John Murray 'besieged' his ancestral home, the garrison commander being Patrick Stewart of Ballechin, a trusted Atholl family retainer.
Finding Dundee's forces positioned on the lower slopes of Creag Eallich to the north, he faced his troops uphill, their line only three men deep to maximise firepower.
[22] Killiecrankie is the first recorded use of the plug bayonet by British troops in battle; this increased firepower by eliminating the need for pikemen but required training and confidence in its use.
An orderly retreat turned into a rout as the army disintegrated; he lost nearly 2,000 men, including his younger brother James, who was killed, while his nephew Robert was seriously wounded.
However, Dundee was shot dead in the final moments, while the Jacobites stopped to loot the baggage train, allowing Mackay and 500 survivors to reach the safety of Stirling Castle.
Mackay spent the winter reducing Jacobite strongholds and constructing a new base at Fort William, while harsh weather conditions led to severe food shortages.
Mackay was sent to Ireland as second in command to General Ginkell; at the Battle of Aughrim on 12 July, he directed his infantry in a series of bloody frontal assaults on the Jacobite positions on Kilcommadan Hill.
When the Irish infantry finally ran out of ammunition, a fourth attempt by Mackay turned their flank and the Jacobite army collapsed when St Ruth was killed.
[27] The Treaty of Limerick on 3 October 1691 ended the war in Ireland; Mackay returned to the Netherlands and was made commander of the British division of the Allied army for the 1692 campaign in Flanders.
However, at the Battle of Steinkirk on 24 July William launched an assault led by Mackay's division; with the element of surprise, they captured the first three lines of trenches and came very close to achieving a stunning victory, but the French quickly recovered.
[28] Confusion and the poor state of the roads prevented William from reinforcing his frontline, which meant fewer than 15,000 of the 80,000 Grand Army were engaged at any point during the battle.
Warfare in this period emphasised the defence and assault of fortified places, avoiding battle unless on extremely favourable terms and denying opportunities to opponents.
[22] Mackay recognised defeat did not change the strategic position and focused on denying the Jacobites access to a port or forcing them to fight on unfavourable terms.
[31] Mackay was a far less effective battlefield commander; in addition to Killiecrankie, his repeated and bloody frontal assaults at Steinkirk and Aughrim show a lack of imagination.
The concept was first demonstrated in 1678 but rejected since the bayonet had a tendency to fall off; sources vary but Mackay either designed or suggested the adoption of a ring system for attaching it to the musket.