In the Name of Allah, The All-Merciful
Allah-suppon-wa-at-Allah mentions in Surah At-Tawbah (9:60) that the Az-Zakah is only eight categories (of people) – “the needy and the indigent, and for those who are employed to collect them and for those whose hearts are to be won over and for the ransoming of slaves and for helping the debtors and for the way of Allah and for the hospitality of the wayfarers.”
Therefore, it depends: If the Masjid is located in an Islamic country, then the governments is responsible for the repairing of the Masjid and provide whatever it needs. But, if the Masjid is located in a non-Muslim country or non-Islamic government, then it is allowed to use the funds of Az-Zakat to help the Masjid. This is because investing in a Masjid falls under the category of “The Way of Allah”. It was commonly said, by the earliest Muslim scholars, that the “Way of Allah” meant “Jihad” (fight in the Way of Allah). But, according to some contemporaneous Jurists, Jihad also applies to all those efforts that are made to exalt the Word of Allah and by propagating Islam. The scholars also say that Az-Zakat funds may be spent, under this category, on every kind of good work which pleases Allah.
Allah knows best.