Mackenzie entered into the Russian Navy in 1765 with the rank of midshipman, initially serving in the Baltic Sea. Later, with a rank of captain lieutenant, he took part in a number of battles in the Russo-Turkish War (1768–74), including the Battle of Nauplia (1770). He was wounded in the Battle of Chesma, where he served under Scottish-born Admiral Samuel Greig and commanded a fireship which contributed to the destruction of the Turkish fleet. On 9 July 1771 he was awarded the Order of St. George Fourth class. For distinction in this battle he was also promoted to captain of the second rank (equivalent to commander). On 21 April 1777 he was promoted to captain of the first rank (equivalent to captain).