COLOGNE, Germany — The impressive Islamic complex here, Germany’s largest, boasts towering minarets and a soaring prayer hall. But what Turkish officials here seem most proud of are the hundreds of windows, which allow outsiders and Muslim worshipers to glimpse each other’s worlds. The idea, they say, is transparency.

Yet it is what lies beneath the surface these days that concerns both Germans and Turks as Turkey prepares to vote on Sunday in a referendum that could vastly expand the powers of its already authoritarian president, Recep Tayyip Erdogan, whose reach into Germany — both open and concealed — has become an increasing point of friction.

Since Turks arrived for work in the 1960s, Germany has maintained the largest Turkish diaspora in Europe, now some three million people. For many years, Germany was happy to let the Turkish state provide and pay for prayer leaders and other provisions for its emigrants. This now includes overseeing more than 900 Muslim associations and training and appointing many of Germany’s imams. The large mosque complex here is a part of that network.

But Turkey’s resulting grip in Germany is coming back to haunt both sides. German intelligence agencies and politicians now charge that Mr. Erdogan is using the decades-old arrangement to hunt down and punish opponents as he pursues a desperately wanted victory that would make his authority all but unchallengeable. Roughly half of the Turks who live in Germany hold Turkish citizenship and are eligible to vote.