It's simple. If a Presbyterian Church or a Jewish Temple would have been allowed in the space of the old Burlington Coat Factory, then the City of New York can't stop the mosque.
The only exception I can think of is a legitimate national security issue. But what kind of a national security issue could a mosqe or a community center create? Are enemy combatants going to build missile silos in the basement?
How is a building a threat to national security?
If individual people are a threat to national security, the answer is simple -- arrest them or deport them, but why is an individual building a problem?