Champions League winners Bayern said an agreement had been reached "in principle" for the 27-year-old, who found his place in the Bavarian team taken by Mario Manduzkic last season.
The two clubs had been negotiating over the transfer for some time, with Bayern saying last week the deal was dead as the Florentine club were reportedly unwilling to meet the German double winners' €20 million asking price.
Bayern's communications director Markus Horwick said a contract until 2017 should be signed "in the next one to two weeks." Gomez is expected to earn around €4 million a season.
Italian newspaper Gazzetta dello Sport claim the transfer will cost Fiorentina €15 million.
Gomez was under contract in Munich until 2016 but was known to have become frustrated at having to play second fiddle to Mandzukic last season.
He was eager to orchestrate a move abroad in order to get more first team football, especially with the World Cup only a year away.
Despite being benched for most of the campaign, he still managed 19 goals last season, including two in the German Cup final.
Known as "Super Mario" after the computer game character, Gomez joined Bayern in 2009 from Stuttgart for €35 million.
He has scored 25 goals for Germany in 58 appearances.