This paper investigates the hypothesis that women are underrepresented in leadership roles due to a lower ability to influence others. By comparing societies that differ in the inheritance rights of men and women, we trace the origins of such difference. The results of a public good game with third party punishment indicate that in patriarchal societies there are persistent gender differences in social influence while in matrilineal societies these differences are smaller. While in the patriarchal society sanctioning behavior is not different across genders, cooperation is lower in groups with a female monitor than a male monitor. In contrast, in the matrilineal society male monitors sanction more often than female monitors, though cooperation does not depend on the gender of the monitor.