The 9-1 shot, ridden by Andrasch Starke and trained by Peter Schiergen, became the first German horse to triumph at the Group One race having won the Prix de l'Arc de Triomphe in 2011.
Aidan O'Brien's St Nicholas Abbey finished third.
Nathaniel looked set to win leading down the home straight but Danedream stole the victory right on the line to become the first filly to win the race since Time Charter in 1983.
"It was close - it was very tight - but I had a good feeling," Starke told the BBC.
"She fought hard and it's definitely the biggest moment in my life."