Same-sex marriage legalization (SSML) is a typical anti-discrimination policy to remove institutional discrimination against sexual minorities by providing them with marriage equality. We examine how this legalization in the Netherlands affected mental health. Conducting a difference-in-differences analysis with heterosexual individuals as a reference group, we find that SSML significantly improved mental health of sexual minorities and substantially reduced the sexual orientation gap of mental health. The beneficial effects were present for both married and non-married sexual minorities. This phenomenon suggests that part of the health gains were related to mechanisms beyond marriage itself.