In the case, Christine Wilson, an inspector with the Health and Safety Executive (HSE), claimed her employer's pay agreement was unfair in linking pay to length of service for up to 10 years.
The HSE's agreement meant three male colleagues on the same level as Wilson were paid more than her for doing equivalent work.
The Equalities and Human Rights Commission (EHRC) argued that linking pay to length of service disadvantages women who take time out to raise children and so do not have the same continuous length of service as men. The Court of Appeal agreed.
It found although employers do not generally have to justify schemes linking length of service to pay, they will have to if there is evidence that this is having a disproportionate impact on women.
Susie Uppal, director of legal enforcement at the EHRC, said: "Women should not be disadvantaged in the workforce because of they take time out for maternity leave or to meet caring responsibilities.
"Linking pay to length of service often does them a disservice. Direct discrimination, long hours, and a lack of flexible working options are some of the biggest barriers to achieving gender equality in the workplace."