24:27 O You who have chosen to be graced with belief! Do not enter the houses other than your own until you have obtained permission and greeted their folk with peace. That is best for you if you would bear it in mind.
They should have asked permission to pray there, the building belongs to others now. By acting in the way they did they are inflaming the anger against Muslims. What would have happened if Christians had walked into an ex church, now a mosque?
If permission had been sought, then this opens the doors to discussion and understanding of each other’s views; talk to them in a beautiful [civilised] manner:-
16:125 Call to the Way of your Lord with wisdom and beautiful exhortation. Reason with them most decently. Your Lord is best aware of him who strays from His Path, and He is best aware of the upright.
16:126 Hence, if you have to respond to an attack in argument, respond only to the extent of the attack levelled against you. But to bear with patience is indeed far better for the steadfast.
16:127 Endure then, with patience, always remembering that it is none but God Who gives you the strength to endure (O Prophet). Do not grieve over them, nor be distressed by the false arguments they contrive.
16:128 For, certainly, God is with the upright, and the benefactors of humanity.