The Poland star, 29, has established himself as one of the best strikers in the world in recent years with Real believed to be big admirers of him.
Speculation regarding a possible move to Madrid has intensified since Lewandowski changed his agent, teaming up with Pini Zahavi in February.
However, Alonso - who played alongside Lewandowski at Bayern - believes his former team-mate should remain at the Allianz Arena.
In an interview with Sport Buzzer, Alonso said: “He is definitely one of the best number nines in the world.
“But I am of the opinion that he is in the best hands with Bayern.”
When pressed on why he believes Bayern are the best fit for Lewandowski, Alonso added: “He scores his goals every year, he knows the club, the league, he wins titles.
“Whether he wants to have another experience, he has to decide for himself.”
Lewandowski has been in remarkable form in the Bundesliga this season, scoring 23 goals in 25 appearances with Bayern on the brink of yet another league title success.