Police responded to reports of the shooting at the building in Vaughan, about 30km (19 miles) north of Toronto, at 19:20 (12:20 GMT) on Sunday, shooting the suspect dead there.
Another injured person has been taken to hospital in a serious condition.
Authorities are investigating the motive, including a possible connection between the gunman and the victims.
York police chief Jim MacSween said attending officers were met with a "horrendous scene", with numerous deceased victims found in different flats of the building.
"We're in the process right now of doing notifications to those families, so at this point I can't share any information on the victims or the subject," he said.
Mr MacSween said there was no ongoing threat to the public, and York police said those evacuated could return to their homes.
In a tweet, Vaughan's mayor Stephen Del Duca extended condolences to the families of the victims.
"I want to recognise the brave first responders who are working to safeguard the situation," he added.
While it has fewer mass shootings than neighbour the US, Canada has recently seen an increase in gun violence prompting recent legislation to ban handguns.
In May 2020 Canada banned 1,500 types of military-grade or assault-style firearms after a gunman disguised as a policeman killed 22 people in Nova Scotia.