Visitors had already left the club, one of the few places where alcohol is served in Muslim Gaza, when the men tied up the security guard and set explosives that blew out windows and ripped up the roof early on Sunday morning.
There was no immediate claim of responsibility. It was the first such attack in Gaza on a UN target and came against a backdrop of increasing unease among foreigners in Gaza.
Just over a day earlier, a group freed three British hostages who had been seized to demand foreign pressure on Israel.
The United Nations is generally viewed with sympathy in the Gaza Strip. Its agency supporting Palestinian refugees is among the biggest employers in the territory.
The club that was blown up is on the beachfront close to hotels where most foreign visitors stay.
Chaos has been increasing in the Gaza Strip since the departure of Israeli troops in September after 38 years of occupation intensified a power struggle among resistance factions, gangs and security forces.
The disorder has worsened in the run-up to parliamentary elections planned for 25 January. Palestinian officials have said that the troubles could force the postponement of the vote.