Eishin Flash was a close third and Admire Rakti fourth, leaving Dunaden as the best-finishing foreign horse in fifth.
Gentildonna won Japan's biggest race for the second straight year -- the first time that feat has been accomplished in the 33-year history of the race. She is a 4-year-old daughter of Deep Impact. Denim and Ruby is a 3-year-old filly by the same sire.
Gentildonna, with Ryan Moore replacing Yusanari Iwata as rider, got the 2,400 meters in 2:26.1 as the favorite with a crowd of nearly 90,000 at Tokyo Race Course.
With the sun setting behind Mount Fuji in the background, Moore kept the filly close to the lead through a moderate pace, guiding her to the lead with about 200 meters to run and appeared to have a clear way to the historic second straight win.
But jockey Suguru Hamanaka had Denim and Ruby on a roll on the far outside and just missed at the wire.
"I found myself in front a little earlier than I'd have liked," Moore said. "Once we were there, it was a matter of hanging on long enough. She showed what a massive will to win she has. It was too close, really, for my liking."
Gentildonna was winless in three previous starts this year, but ran well in each race. Still, the string of defeats led to the jockey switch.
Trainer Sei Ishizaka said he plans to rest Gentildonna for the remainder of the year but keep her in training in 2014. He said he has not formulated a schedule for her but indicated the Dubai Sheema Classic, in which she finished second to St Nicholas Abbey this year, "would be a very big possibility."
The disappointments of Sunday's race were Gold Ship, who finished 15th, and Eishin Flash, who was 10th. The other two foreigners, Simenon and Joshua Tree, were never in contention and finished 13th and last, respectively, in the 17-horse field.