Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

For seven years, AnnMarie Duchon fought to receive the same salary as her male counterpart at the University of Massachusetts Amherst. Duchon said she and her male counterpart were doing the exact same job — but not making the exact same pay.

"We graduated from the same graduate school, the same university on the same day. It was the same amount of professional experience," she told NBC News.

Supporters watch as Massachusetts Gov. Charlie Baker signs a bill at the Statehouse requiring men and women be paid equally for comparable work Monday, Aug. 1, 2016, in Boston. Elise Amendola / AP

A protracted battle with her employer eventually led to Duchon giving testimony before Congress on pay inequality. Eventually, the single mother was awarded the same salary as her male colleague.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

This month, in an effort to close the widespread wage gap and prevent other women from having to fight the same battle as Duchon, Massachusetts Gov. Charlie Baker signed the "Pay Equity bill" into law. This legislation prohibits companies from asking prospective employers their current or past salary history.

"This matters so much because, often, if people get a lower salary than their skills and experience would have warranted early in their career, if an employer can benchmark their salary against it, you get a snowfall effect,” said Victoria Budson, Executive Director of the Women and Public Policy program at the Harvard Kennedy School of Government.

"What's passed here in Massachusetts is going to be a model used in the rest of the country," she predicted.

Read More: Apple Says it Has Fixed the Gender Pay Gap

It's a problem all too familiar to women in different industries, including Boston attorney Erinn Gloster.

"They're asking for your entire salary history," she said of employers' intrusive interview requests. "It almost felt like in some ways I had to justify why I was asking for a certain salary," Gloster recalled.

Gloster joined a networking group called Levo that promotes equal pay for women.

Read More: 'Motherhood Penalty' Can Affect Women Who Don't Even Have Children

For both Duchon and Gloster, they now take satisfaction in knowing the playing field is more level.

"I think it's really important because I believe a lot of women start their salary lower because that's used against them. So it's promising," Duchon said.