Police said the victim was set upon by up to eight men in the Heights area at about 02:00 BST on Sunday.
A 30-year-old man was arrested but has since been released on police bail pending further enquiries.
Police have appealed for information about the attack.
A 28-year-old man has been beaten by a gang armed with metal bars and bats in Coleraine, County Londonderry.