LOS ANGELES—When Hasna Maznavi would show up to pray at her Southern California mosque, even during off hours, the few men in the main hall would gently point her upstairs to a separate area for women.

“I started to feel unwelcome,” said the 29-year-old comedy writer and film-school graduate.

To Ms. Maznavi and fellow Muslim Sana Muttalib,...