David Stanley William Ogilvy was the eldest son of David Graham Drummond Ogilvy, 10th Earl of Airlie. His mother was the Honourable Henriette Blanche née Stanley, daughter of the 2nd Baron Stanley.
Born at Florence in Italy on 20 January 1856, he was educated at Eton and Balliol College, Oxford. On 25 September 1881 he succeeded his father, becoming the 11th Earl of Airlie. On 19 January 1886 at St George's Hanover Square he married Lady Mabell Frances Elizabeth Gore, daughter of the 5th Earl of Arran. Their marriage produced three sons and three daughters.
He joined the Army in 1874, serving as a Lieutenant in the Scots Guards and in the 10th Hussars. He saw action in the Second Afghan War between 1878 and 1879, in the Sudan Expedition of 1884 and in the Nile Expedition in 1884 and 1885, being slightly wounded at Abu Klea and again at El Gubat, and twice mentioned in despatches. In December 1897 he gained the rank of Lieutenant-Colonel in the 12th Lancers. He fought in the Boer War in 1900, and was mentioned in despatches for gallantry at Modder River, and was again wounded near Brandfort. On 11 June 1900, aged 44, he was killed in action at Diamond Hill in the Transvaal.
According to his obituary in the Morning Post (14 June 1900), 'By his death the British nation loses one of its bravest and most distinguished soldiers. His courage was extraordinary, and those who knew him and had fought with him will understand the reasons which prompted Lord Roberts, in making the sad annoucement, to say: "I deplore the death of that gallant soldier the Earl of Airlie." For centuries the members of the Airlie family have been famous fighters for their country, but no member ever served his nation better or did more to sustain the great name than did the eighth [sic] Earl, whose death will be regretted by a wide circle of relatives and friends.'
In 1963, his grandson, Angus Ogilvy, married Princess Alexandra of Kent, a granddaughter of King George V.
Photographed by Camille Silvy of London.