In «مَسَاجِدِ الْمَدِينَةِ», الْمَدِينَةِ is the muḍāf ilayh.

Restoring Declension: Indefinite Names, Al- and Iḍāfah