The billionaire-president, holding true to his campaign promise, this week ordered US officials to begin to design and construct a wall along the 2,000-mile (3,200-kilometre) US-Mexico border.
While the White House has also threatened to tax Mexican imports to cover its cost, Mexican President Enrique Pena Nieto cancelled a planned Washington in protest.
Berlin's mayor said his city -- which was split by the Berlin Wall during the Cold War from 1961-89 -- "cannot look on without comment when a country plans to build a new wall".
"We Berliners know best how much suffering was caused by the division of an entire continent with barbed wire and concrete," he said in a statement, referring to Europe's "Iron Curtain" division.
In the early 21st century, he said, "we can't just accept it if our historical experience is disregarded by those to whom we largely owe our freedom, the Americans."
Pointing to the ongoing division of the Korean peninsula and the island of Cyprus, the Social Democrat urged Trump "not to go down this wrong path of isolation and exclusion".
Mueller also recalled former US president Ronald Reagan's famous 1987 challenge to then Soviet leader Mikhail Gorbachev to "Tear down this wall!", and said in his message to Trump: "Dear Mr President, don't build this wall!"