Mackenzie was born in Westchester County, New York, to Commodore Alexander Slidell Mackenzie and Catherine Alexander Robinson.
He initially attended Williams College, where he was a member of the Kappa Alpha Society, and then accepted a nomination to the United States Military Academy, where he graduated at the head of his class in 1862.