A prominent gay activist was tackled and beaten by bouncers at a Queens nightclub because he was dancing with a man, cops said yesterday.

Tarlach MacNiallais, 47, was punched and kicked and had a chair smashed over his head in the attack by two security guards at the Guadalajara De Noche restaurant in Jackson Heights at 12:43 a.m. Saturday, police said.

The attack is being treated as a possible hate crime.

“[The bouncer] said, ‘You can’t do that here, this is not a gay bar,’ ” MacNiallais told cops. “I said I have just as much right as anyone else.”

MacNiallais — spokesman for the Irish Lesbian and Gay Organization, which is best known for its annual fight to march in the St. Patrick’s Day Parade — said the bouncers wrestled him to the ground and dragged him away from other dancers before they attacked him.

He was treated for cuts and bruises at Elmhurst Hospital Center.

Messages left for restaurant manager Carlos Carrillo were not returned yesterday.