These are the first acquittals since Islamic courts in Bauchi city began trying a group arrested late last year for alleged homosexual offences.
The men were arrested after residents raided a home in Bauchi, finding one of them wearing shorts while the other was fully clothed.
Five people have been convicted of homosexual offences by Bauchi's Islamic courts since January.
They were sentenced to 20 lashes each.
The cases of five other suspects are pending, including that of a Christian who is expected to be tried in a secular court.
Homosexual acts are illegal in Nigeria under Islamic and secular law.
Same-sex marriages, gay groups and shows of same-sex public affection are now banned throughout Nigeria.