Moncton Fire Department officials say the blaze was reported after midnight.
Flames could later be seen shooting several metres in the air from its upper level and roof.
Don McCabe, the deputy fire chief in Moncton, said the scene was complete chaos when fire crews arrived just after 1 a.m. He said people were hanging out of windows and were ready to jump from the fourth floor.
"We tried to stop them from jumping. So the firefighters rescued two people by ladder," he said.
At least three of the residents were treated at a Moncton hospital on Friday morning.
One of the residents suffered a broken leg when he jumped from a third-storey window to escape the fire. A pregnant woman and another resident were taken to the hospital to be treated for smoke inhalation.
Duane Dewolfe said he was trapped inside his fourth-floor apartment.
"I opened up my door and the hallway was full of smoke," he said.
"So I closed it and went back into the apartment. I opened up my window and then the firemen told me to get out of the building so they ended up coming to get me and taking me out."
A firefighter was also injured when part of the ceiling collapsed on his head.
McCabe said the firefighter was also taken to the hospital.
"We didn't want to take any chances so we took him to the hospital with possible spinal injuries," he said.
McCabe says the fire was a challenge to fight because it got trapped inside the building's walls
There is no immediate word on the cause of the fire, according to fire officials. The investigation is continuing.
A Canadian Red Cross disaster team is providing emergency support to 21 people from 11 apartments.Suggest a correction