They are due to appear in court later.
Nigerian newspaper Punch reports that the police raided a hotel in Lagos State on Saturday afternoon and says the hotel was cordoned off while the investigation was carried out.
Homosexual acts are punishable by up to 14 years in jail in Nigeria, while gay marriage and displays of same-sex affection are also banned.
Chris Ewokor, BBC Africa, Abuja
Nigeria has an influential Christian evangelical movement in the south and strong support for Islamic law in the north, both of which oppose homosexuality.
Since Nigeria passed a law criminalising same sex marriage and gay organisations in 2013, law enforcement agents have cracked down on people suspected of homosexuality. However, arrests are infrequent as homosexual people live in hiding.
Gay people live in fear and cannot openly express their sexual orientation. They are not protected by any law so they face discrimination.
Northern states under Sharia - Islamic religious law - have the death penalty for people convicted of same-sex offences which in other states carry a 14-year jail term.
This is not the first arrest for engaging in acts of homosexuality but so far prosecutions have never ended in prison.
Same-sex relations are explicitly banned in 72 countries, according to the International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA).
The number of states that criminalise same-sex relations is decreasing annually, though, with Belize and the Seychelles repealing such laws last year.
Nigeria is one of a small number of countries which has gone against a global trend.
The country has had a ban on gay relationships since 1901, and in 2013 also outlawed same-sex marriages, gay groups and shows of same-sex public affection.

Accompanied by the Youth Music Voices choir, Walsh and Boe will debut their version of the classic Queen track on 11 May at London's Royal Albert Hall.
The official Team GB and Paralympics GB single will go on sale the same day.
"So excited to be supporting Team GB with Alfie," said Walsh. "Bring on the gold medals!"
The original track
, based around one of Brian May's most recognisable riffs, was a top 10 hit for Queen in 1985.
The lyrics have been slightly tweaked for the  
          Olympic version
 - the phrase "one man" becomes "one team" throughout the song.
Also missing is Freddie Mercury's infamous pay-off: He originally sang "Fried Chicken" instead of the title during the fade out.
The BBC's home of 2012: Latest Olympic news, sport, culture, torch relay, video and audio
Walsh, who has enjoyed massive chart success with her fellow Girls Aloud stars, is currently playing Princess Fiona in Shrek The Musical at London's Theatre Royal.
"It's a huge honour to sing One Vision for Team GB with Kimberley," said Boe, who was acclaimed for his performance in the 25th anniversary concerts of Les Miserables.
"Being a massive Queen fan, I was very excited about recording the track - I hope everyone likes it."
The Duke and Duchess of Cambridge will join the official Team GB launch party, Our Greatest Team Rises, at the Albert Hall next week, alongside a host of British Olympians.
More than 40 men have been arrested in Nigeria over the weekend for performing homosexual acts, police say.
[NEXT_CONCEPT]
Girls Aloud star Kimberley Walsh and leading tenor Alfie Boe are joining forces to sing on One Vision, the official single for Team GB.