Gender discrimination in South Asia is a well-documented fact. However, gender is only one of an individual's many identities. This paper investigates how gender discrimination depends on the social identities of interacting parties. We use an experimental approach to identify gender discrimination by randomly matching 2,836 male and female students pursuing bachelor's-equivalent degrees in three different types of institutions - Madrassas (religious seminaries), Islamic universities, and liberal universities - that represent distinct identities within the Pakistani society. Our main finding is that gender discrimination is not uniform in intensity and nature across the educated Pakistani society and varies as a function of the social identity of both individuals who interact. While we find no evidence of higher-socioeconomic-status men discriminating against women, men of lower socioeconomic status and higher religiosity tend to discriminate against women - but only women of lower socioeconomic status who are closest to them in social distance. Moreover, this discrimination is largely taste-based. Our findings suggest that social policies aimed at empowering women need to account for the intersectionality of gender with social identity.