Several empirical studies have shown that the effect of openness on the gender wage gap depends on the skill requirement of the workplace. This paper offers a theoretical explanation to understand that finding. We integrate a statistical discrimination framework with the labour assignment approach to give general conditions under which the matching between firms and workers gives rise to a wider gender wage gap at the upper tail of the distribution, in accordance with empirical evidence. We further look at the effect of trade openness on the gender wage gap along the entire distribution. Workers' characteristics vary in two dimensions, skills and job commitment. The inability to observe individual's job commitment induces employers to base partly their decision on group average. Following the literature on labour and international trade, we assume that skills act as complements to technological upgrading. Exporting firms are more skill-intensive and pay higher wages ; assuming further that worker's job commitment is a complement to technological upgrading, we find that a reduction in trade costs increases wage inequality within-groups and has non-monotonic effects on between-group inequality. Trade openness reduces the gender wage gap among unskilled workers but increases the gender wage gap among high-skill workers.