By Agence France-Presse
A video obtained from the mobile telephone of one of the two men provided evidence that the act "happened with the consent of the three parties," a prosecution statement said late Tuesday.
Consensual sex outside wedlock is a crime in the Muslim city state, but the prosecution said the three are free to leave.
"Following the closure of the case, all three parties involved in the case are in the process of receiving their passports and are free to leave," it said.
The woman, identified only as ZJM, had lodged a rape complaint against the two men in late October, it said. Police arrested the two men and questioned them.
Police then released all three on bail but held their passports "to facilitate proper investigations," the statement said.
British advocacy group Detained in Dubai welcomed the decision not to press charges of consensual sex outside marriage against the woman, who it said was a tourist.
"We expect that the international outrage that this case deserved, influenced authorities to drop the charges, in order to spare the UAE (United Arab Emirates) of such negative press," it said in a statement on its Facebook page.
Home to luxurious resorts and a lively nightlife, Dubai has become a popular destination for tourists, many of whom are unaware of the strict Islamic rules applied in courts.
The emirate is also home to a large foreign population. Several westerners have been in legal trouble in the past.
A Norwegian woman who reported being raped by her boss received a 16-month jail sentence in 2013 for extramarital sex, perjury and consuming alcohol without a licence after retracting her initial statement.
She was freed after receiving a special pardon from the ruler.
Two Britons were convicted of sex on the beach in 2008, while a British mother-of-two and her alleged lover were jailed for adultery after being reported by the estranged husband.