Gates also testified that he never witnessed any criminal conduct from Epstein.
He accused Epstein of blackmailing him over his extramarital affairs.
"These affairs had nothing to do with my interactions with Epstein but they were painful for my family," Gates said, according to a copy of his opening statement.
"Epstein was working to use information about my infidelities - in addition to many lies that he layered on top - to pressure me to re-engage with him."
Congress has been investigating the US Justice Department's handling of the Epstein case.
The billionaire's testimony concerned his contacts with the convicted sex offender who ensnared women and girls from poor or unstable backgrounds.
The Microsoft Corp co-founder testified privately to the House Oversight and Government Reform Committee, which is investigating possible federal mismanagement in the cases against Epstein and his associate Ghislaine Maxwell and related issues.
US Representative James Comer, the Republican committee chairman, asked Gates in a March letter to appear for an in-person transcribed interview.
Gates hired Jake Greenberg, who was the oversight panel's chief investigative official until December, to help him prepare for the appearance, the New York Times reported on Tuesday.
A committee spokesperson told Reuters the panel has not worked with Greenberg since his departure.
Epstein pleaded guilty to a Florida state felony prostitution charge in 2008 and served 13 months in jail.
Federal prosecutors charged him with sex trafficking of minors in 2019.
Epstein pleaded not guilty to those charges and died in a Manhattan jail cell in what was ruled a suicide by New York City's medical examiner later that year before his trial.
Documents released by the US Justice Department this year indicated that Gates and Epstein met repeatedly after Epstein's 2008 prison term to discuss expanding the tech billionaire's philanthropic efforts.
They also included pictures of Gates posing with females whose faces are redacted.
Gates has previously said the relationship with Epstein was confined to philanthropy-related discussions and has said it was a mistake to meet with him.
Gates "took responsibility for his actions" in a February town hall meeting with employees of the Gates Foundation, a spokesperson for the philanthropic group told Reuters.
Gates' relationship with Epstein has drawn in the Gates Foundation, which said in April it had begun an external review into its engagement with the late financier.
Emails released in January by the Justice Department also showed communication between Epstein and the Gates Foundation's staff.
The House committee's probe includes authorities' handling of investigations and prosecutions, plea deals, Epstein's death, failures to combat sex trafficking, ethics concerns and delays in the release of government files.
The Justice Department's release of millions of internal documents related to Epstein revealed his ties to many prominent people in politics, finance, academia and business, including President Donald Trump, who socialised extensively with Epstein in the 1990s and 2000s.
Former attorney general Pam Bondi, fired by Trump in April, faced sharp criticism for her handling of the case.
Some critics accused her of trying to shield Trump from scrutiny.
Trump opposed releasing the files until shortly before Congress overwhelmingly passed a law ordering their release.