Two of the victims were severely injured. The gunman later fled the scene, and the mosque was cordoned off.
Police, who rushed to the scene in a central neighborhood known for trendy cafes and the city's red-light district, were also investigating a possible connection to the discovery of a corpse at nearby Gessner Bridge over the Sihl River, police spokesman Marco Bisa later said.
Authorities weren't considering the attack as extremism, he said.
Police also said it was too early to determine whether there might be any link to an incident in Berlin also on Monday, where a truck rammed into a Christmas market, killing at least nine people.
Bisa later stated the injured were taken to hospital and were aged 30, 35 and 56 years old, but did not specify their nationalities.
Witnesses had described the attacker as clad head to foot in black, and was believed to be about 30 years old.
Attacks by gunmen are rare in Switzerland. The country was shaken in 2013 by at least two multiple-fatality shootings.
S/SH 11