Estimate, a five-year-old mare trained by Michael Stoute, is one of five horses understood to have recorded a positive test for morphine.
The palace said they believed the morphine had come via consumption of a contaminated feed product.
The horse saw the Queen become the first reigning monarch to win Royal Ascot's Gold Cup. In this year's race, Estimate came second to the winner Leading Light.
The Queen has been informed following an announcement by the British Horseracing Authority last Thursday, according to John Warren, the Queen's Bloodstock and Racing Advisor.
"I can confirm that one of those horses was Estimate, the five-year-old mare trained by Sir Michael Stoute and owned by the Queen. Initial indications are that the positive test resulted from the consumption of a contaminated feed product," he said.
He said Stoute is "working closely" with the feed company involved to uncover how morphine may have contaminated the food prior before it was delivered to Estimate's stables.
If the test is confirmed by the BHA then Estimate will be disqualified from second place in this year's Gold Cup and the prize money of 80,625 pounds will automatically be forfeited.
