A former WeWork Cos. executive has accused the workspace-sharing startup and the company’s co-president of gender discrimination and retaliation, claiming that she had been forced out of her job after repeatedly raising concerns with management.

Lisa Bridges, who headed the company’s compensation programs, said in a complaint filed Thursday in Manhattan Supreme Court that WeWork had a “dearth” of women in senior-level positions and paid women “significantly less than men.”