Who coined the phrase ‘dark horse’?

One dictionary definition of the phrase ‘dark horse’, in the idiomatic sense – that is, when used to describe something more than just the colour of a horse – is ‘someone who wins a race, competition, election etc. that no-one expected them to win’. Interestingly, the earliest known reference to the phrase, in this sense, occurs in the high-society novel ‘The Young Duke’, written by Benjamin Disraeli, who would later serve twice as British Prime Minister, in the years before he entered the House of Commons in 1837. In the novel, published in 1831, the titular protagonist, the Duke of St. James, witnesses a horse race, about which Disraeli writes, ‘A dark horse which had never been thought of, and which the careless St. James had never even observed in the list, rushed past the grandstand in sweeping triumph.’