Major McKim was born in Baltimore to William McKim and Margaret (Hollins) McKim. He graduated from Harvard in 1852. He enlisted as a Private in Co. H, 1st Maryland Infantry, in June 1861.
Maj. McKim was KIA at Chancellorsville. His division commander, Gen. Colston (Gen. Trimble being absent sick), reported, "The chivalrous Duncan McKim, of Gen. Trimble's staff, fell while conducting reinforcements to repel the enemy."
In 1910 his cousin, Randolph Harrison McKim (1842-1920), wrote of Maj. McKim, "I went to the battle-field about ten days, perhaps two weeks, after he fell, found the spot where he was buried, and had him disinterred. He had been wrapped in his blanket and buried without a coffin, and mother Earth had so closely held him in her embrace that when we lifted him up and unwound the blanket, he lay before us as perfectly preserved as if he had fallen only a few hours before. We buried him in the cemetery at Staunton, whence, upon the conclusion of the war, he was removed to Greenmount Cemetery, Baltimore. There he rests in peace — 'Siste viator, heroa calcas.' I was now the last survivor of the three of my name who had entered the Confederate service at the outbreak of the war."