D'Bai (8-1) came through the pack in the final furlong to claim the Porsche Handicap under top weight at Ascot.
Charlie Appleby's gelding, wearing blinkers for the first time, weaved his way into contention in the hands of William Buick to challenge Pealer, who had set sail for home.
D'Bai, wearing the Godolphin colours, got on top close home to deny Pealer by a neck. Fire Brigade snatched third place in the final strides, but was two and a quarter lengths behind the first two.
Buick said: "He'd got blinkers on for the first time and that helped him focus a little bit. He travelled strongly through the race, probably too strong early on.
"He was last off the bridle. When he gets there he has a look.
"It was a drop in grade and nice to get his confidence back and get him back on track. He has a high cruising speed and hopefully it's onwards and upwards for him."
Appleby said: "He is a horse that we liked since he was a two-year-old. He broke his maiden at the July Course, but he has been a bit frustrating along the way.
"His home work is always very good. He has been gelded and we have gone for the full headgear and replaced the cheekpieces with blinkers.
"The plan was to bury him and ride him for a lot of luck. He is the sort of horse that likes to travel. It was a great ride from William, he gave him a peach of a ride.
"He won on easy ground at Pontefract in a Listed race so the conditions were there to suit. I ran him in the French Derby and I don't think the trip beat him, he was just not good enough. The mile looks to be the right trip."