The Germany international has claimed that he could have joined the Liga giant but preferred a move to Serie A instead.
The Germany international was deemed surplus to requirements by new Bayern coach Pep Guardiola this summer and a number of clubs showed an interest in signing the prolific striker.
However, the 28-year-old needed little time to make a decision on his future when Fiorentina made an approach and he rejected a transfer to Madrid.
"It's true that Carlo Ancelotti wanted to sign me for Madrid," Gomez confirmed when questioned about the Santiago Bernabeu side's interest by Kicker. "I was honored by their interest, because my entire family consists of Real Madrid fans.
"However, after holding talks with Fiorentina about their plans for the future, I knew joining Fiorentina was the right choice for me."
Gomez has so far netted two goals in four official games for Fiorentina.