Praise be to Allah.
We put this question to Shaykh Muhammad ibn ‘Uthaymeen, who answered as follows:
They have to evaluate the price of the mosque first, and build another mosque in another place and take possession of it, then they can do whatever they wish.
They say, “At the moment we cannot afford to build another mosque, and we cannot sell this mosque, so can we rent it out?” They say, “We cannot sell it.”
Because according to the system in that kaafir country, this mosque is registered with the city as real estate that cannot be sold.
If that is the case, then it is OK. They can rent it out and put the rent towards the expenses for other mosques.