The gender gap in risk-taking is often used to explain differences in labor market outcomes. Some studies, however, suggest that this gender gap does not extend to professional contexts. This paper examines potential drivers of the gender gap in risk-taking, comparing the professional context of academia to a private setting. We draw on identity economics, which posits that individuals form multiple identities that moderate behavior across contexts. In an online field experiment with 474 scientists we vary the salience of the professional or private identity. We find that the gender gap in risk-taking is mediated when the professional identity is salient. We identify the switching of identities by females as an explanation. Our results suggest that if the gender gap in risk-taking is driven by selection, the selection is not (only) along risk-aversion, but (also) along the ability to switch between identities and to adapt to prevailing norms. This provides new insights for the discussion on gender, risk-taking and labor market policies, and suggests an important role for mentoring programs.