Previous research supports that both empathic concern and perspective‐taking are predictors of altruistic behaviours in dictator games. Less is known, however, about how the identity of the victim and the perpetrator and the strength of ingroup identity of the observer in such games impacts upon preferences for altruistic compensation and punishment. Focusing on gender identity, the present research aimed to examine the effects of empathy, perceived injustice and ingroup identity strength on preferences for altruistic compensation and punishment. Female adult participants (n = 116) were recruited through an online survey conducted in the United Kingdom. Using a dictator‐style game, participants were randomly assigned to observe either a male or female distributing resources to a female victim, after which they were asked to rate their feelings of injustice and then completed a series of measures including empathic concern, perspective‐taking and strength of gender identity. Results demonstrate that empathic concern and perspective‐taking predicted third‐party altruistic preferences but there was no effect of experimental condition (perpetrator identity). Results have implications for promoting perspective‐taking‐focused empathy intervention in occasions where distributive inequality or intergroup bias frequently occurs. These are also the insight to female’s awareness of gender equality and a novel enforce of norm violations.