Officers busted 14 men holding the party in two hotel rooms in Surabaya, the second biggest city in Indonesia, around midnight on Sunday.
Some of the men were watching gay porn and performing "deviant sexual acts", said Shinto Silitonga, Surabaya police's head of detectives.
Police named eight men as suspects and filed preliminary charges against them under Indonesia's tough anti-pornography law. Two of the eight could face up to 15 years in jail for initiating and facilitating the event.
Six others were released.
"This is the first time we enforce the law and arrest gay people in the city," Silitonga told AFP.
Except for Aceh province, which upholds sharia law, gay sex is not illegal in Indonesia, which mainly follows a criminal code inherited from former colonial ruler the Netherlands.
However, there was a backlash against the country's LGBT community last year with government ministers publicly making anti-gay statements.