The club has agreed a deal in principle with the Viola and the move will be finalized within the next couple of days.
The Germany international struggled for regular first-team football at the Allianz Arena last season after losing his place to teammate Mario Mandzukic.
The move will be officially completed within the next couple of days following talks on Monday between Bayern CEO Karl-Heinz Rummenigge and Viola president Andrea Della Valle.
"It was the desire of Mario Gomez to leave Bayern Munich to Florence. We have now complied with his wish," Rummenigge told the club's official website.
"He has thus made a major contribution to two German championships and two DFB Pokal victories. The highlight was of course the Champions League victory and winning the treble last season. I would like to thank him for his performances for Bayern. On behalf of Bayern, I wish him luck and success in Florence!"
Gomez became the most expensive player in Bundesliga history when he signed for Bayern from Stuttgart in 2009 for 30 million euros. Since then Javi Martinez and Mario Gotze - both Bayern players - have surpassed that milestone.
Gomez played 174 games for Bayern, scoring 113 goals.
The striker becomes Fiorentina's eighth acquisition this summer having landed among others, goalkeeper Gustavo Munua, defender Marcos Alonso and midfielders Massimo Ambrosini, Juan Cuadardo and Joaquin.