The 30-year-old scored 14 goals in 47 appearances for Fiorentina after joining from Bayern Munich in 2013.
He will replace Demba Ba at Besiktas after the Senegal striker moved to Shanghai Shenhua in China.
“Besiktas announce that on Thursday the club reached an agreement with Fiorentina for the loan of Mario Garcia Gomez,” read a statement on the club’s website.
“The contract includes an option to make the deal permanent.”
Gomez was hampered by injuries during his time with La Viola and only made 29 Serie A appearances over two seasons.
He has won 60 caps for Germany and will join compatriot Lukas Podolski in Turkey after the former Arsenal man joined Galatasaray earlier this summer.