The two actors both appeared in All The Money In The World, which required extensive reshoots after Ridley Scott axed Kevin Spacey from the film following allegations of sexual assault.
Spacey was replaced by Christopher Plummer, who received an Oscar nomination for his portrayal of J Paul Getty.
Both Williams and Wahlberg returned for the reshoots, with reports later emerging that Wahlberg was paid $1.5 million dollars (£1.1 million) and Williams just $1,000 (£728).
Speaking in Washington DC on Tuesday (2 April) during a hearing about closing the gender pay gap, Williams said she was "paralysed in feelings of futility" after learning of the pay disparity.
"In late 2017, the news broke that I'd been paid less than $1,000 compared to the $1.5 million that my male counterpart had received for the exact same amount of work," she said.
"And guess what, no-one cared. This came as no surprise to me, it simply reinforced my life-learned belief that equality is not an inalienable right and that women would always be working just as hard for less money while shouldering more responsibility at home."
Williams, who has four Oscar nominations compared to Wahlberg's two, added: "I've been a working actress since the age of 12. I've been accredited by my industry at the highest levels and that still didn't translate to equal compensation."
Williams said that people only started paying attention to the controversy after Jessica Chastain tweeted about it.
"Jessica's audience was much wider than mine and she wasn't afraid to pick up a megaphone and be heard," she said.
Access unlimited streaming of movies and TV shows with Amazon Prime Video Sign up now for a 30-day free trialSign up
"Heard she was, there was an uproar and a public shaming within my industry that resulted in a two-million-dollar donation to the Time's Up Defence Fund."
Wahlberg donated his cheque for the re-shoots to the Time's Up Defence Fund while the talent agency William Morris Endeavours (WME) donated a further $500,000 (£364,000) to the initiative, set up to help fund accusers of sexual harassment and abuse.
Williams said the controversy had improved her experiences on film sets.
"I could tell my workplace was shifting," she said. "Rather than being grasped too tightly or hugged for too long as a morning greeting, my hand was shaken and I was looked squarely in the eye and I was welcomed to my Monday morning."
Williams added: "On the job I just completed two weeks ago, I have to tell you, I was paid equally with my male co-star."
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies