A judge ordered that details of the deal between Strauss-Kahn and Nafissatou Diallo, a 33-year-old illiterate migrant from Guinea, be kept confidential.
Diallo said the one-time French presidential hopeful emerged naked from the bathroom of the hotel suite she was cleaning and forced her to perform oral sex. Strauss-Kahn said the acts were consensual.
Strauss-Kahn's lawyers have dismissed reports that the maid would receive several million dollars, but experts said a substantial payment is the norm in such a case.
Strauss-Kahn, 63, was not in New York for the hearing. He is also under investigation over other scandals in France.
Monday's accord enables him to close one chapter. But Strauss-Kahn has another tough legal date on December 19th, when he will learn whether he faces an investigation into pimping charges arising from allegations that he helped arranged sex parties with prostitutes for wealthy men.
Diallo, a widowed mother of a teenage daughter, emerged from more than a year in hiding to attend the 10-minute hearing before Judge Douglas McKeon.
Outside the court, she said: "I thank everyone who supports me. I thank God, and God bless you all."
Diallo also settled a separate action against the New York Post tabloid, McKeon said. The newspaper had alleged after the sex assault case erupted that Diallo was a prostitute.
Her lawyer Kenneth Thompson called Diallo a "courageous woman who never lost faith in our system of justice. With this resolution she can now move on with her life."
Strauss-Kahn's lead lawyer, William Taylor, said in a statement: "On behalf of Mr. Strauss-Kahn, we are pleased to have arrived at a resolution of this matter. We are grateful to Judge McKeon whose patience and forbearance allowed this agreement to be formulated."
An international scandal erupted after Diallo alleged that Strauss-Kahn assaulted her at the New York Sofitel on May 14, 2011.
The IMF managing director was detained on a plane at John F. Kennedy airport and was held for several days at New York's tough Rikers Island jail. He soon had to resign from his post at the global lender.
In August 2011, prosecutors dropped criminal charges, declaring that Diallo was not a credible witness. Strauss-Kahn quickly returned to France even though the maid maintained a civil suit.
McKeon said he first met Diallo over the litigation early this year and she had indicated at a November 28 meeting that an out-of-court agreement was possible. More intensive talks have been held since.
"About 10 minutes ago, we reached a settlement in this case which was put on record," McKeon told the hearing.
"I've developed a great affection for all of you and have gotten to know Ms Diallo through the time that I spent with her," the judge told the lawyers and Diallo.
Strauss-Kahn's lawyers had previously dismissed as "dramatically inaccurate" a report in France's Le Monde newspaper that Diallo would be paid $6 million.
But a former US prosecutor Matthew Galluzzo said the figure was plausible and predicted a sum of around $5 million.
French prosecutors launched several separate investigations as the lid came off the high-flier's covert but rampant appetite for extra-marital sex.
Young French author Tristane Banon accused him of trying to rape her in 2003. Investigators concluded that while there was evidence of sexual assault, the alleged attack had occurred too long ago to be prosecuted.
Another probe heard a claim that Strauss-Kahn had taken part in the gang rape of a Belgian prostitute. It was eventually dropped when she recanted and said she had consented to sex.
The scandals have buried Strauss-Kahn's hopes of claiming what many had thought would be a strong Socialist candidacy for the French presidency.
He has also separated from his wife, leading French journalist and wealthy heiress Anne Sinclair.