This paper investigates the effect of public‐contest recruitment on earnings for men and women using Italian microdata over a time period of ten years. We find that the gender pay gap vanishes, and even reverses among young employees when they are selected through public contests. The results suggest that selection mechanisms like public contests may offer a way for merit‐based and gender‐fair wage‐setting. However, since public contests and the public sector are highly correlated, we analyze the gender pay gap by taking into account both the connection between the public and private sector and the open contest issue. By decomposing our results by sector, we find that public contests are a necessary but not sufficient condition for merit‐based and gender‐fair recruitment. Similarly, the institutional environment of the public sector is a necessary but not sufficient condition for ensuring that public contests are merit‐based and gender‐fair screening devices. Taken together, these two factors cause the gender pay gap to disappear.