The rolldown gate of the Garment Center Congregation has not risen in months, the lights are out, the menorahs and Torahs are gone, the vestibule is full of refuse.

By the end of the year, demolition will begin on the six-story building at 40th Street and Seventh Avenue that housed the congregation. It was also the former fashion campus of the Parsons School of Design. In its place a 29-story hotel will rise.

But what could have been the synagogue’s demise has instead led to its rebirth, thanks to an unconventional lease signed nearly 40 years ago and an unexpected landlord better known for a very different religious project.

“My eldest daughter, Sara, she asked me recently, ‘Poppy, are you the first Muslim to build a synagogue?’ ” said Sharif El-Gamal, the developer of the controversial, and eventually scaled-back, plan to build an Islamic community center about two blocks from the World Trade Center. “I said: ‘No, honey, I’m sure there were others before. But maybe in New York I am.’ ”