Dettori, replacing the ill Jamie Spencer, dictated affairs in the Group Two for juveniles to complete a big-race double after steering Stradivarius home in the Lonsdale Cup.
He had the Kevin Ryan-trained colt out of the stalls smartly and led all the way over six furlongs to give the Hambleton Lodge handler a fourth Gimcrack triumph.
Legends Of War made late gains on the leader, but was still half a length down on Emaraaty Ana (5-1) at the line. Shine So Bright was three-quarters of a length back in third.
Aidan O’Brien’s The Irish Rover was out of the placings.
Ryan said: “It’s great to win it again, that’s four times now.
“He’s always been very good, he won first time but then I was a little disappointed at Newbury when the ground was a bit loose.
“He’s still immature, but will definitely get further. Frankie just said not to over-race him this year, as he’ll make a lovely three-year-old.
“I thought his immaturity might find him out close home, but he dug deep.
“You don’t tell Frankie how to ride a horse, but I did say to him don’t be afraid to make it.”
The son of Shamardal was given a 20-1 quote for the Qipco 2000 Guineas by RaceBets, and Ryan added: “He should get a mile next year so that makes you think about the Guineas.
“I think he’ll run again, possibly the Dewhurst but nothing is set in stone.”
John Gosden said of Legends Of War: “He ran a lovely race. I couldn’t be more pleased with him.
“He was nicely ridden. The winner was always too good for us, but I’m really, really happy.
“To finish second in the Gimcrack is great and that (six furlongs) is his trip.
“We’ll go straight to the Middle Park.”