The fire service said control room staff gave “survival guidance” to trapped residents after the flames spread to the flats above.
They were later located and taken to Edinburgh Royal Infirmary by ambulance.
The Scottish Fire and Rescue Service said that when crews arrived at the incident they were confronted with a “severe fire”.
While fire crews doused the flames, search and rescue teams made their way through the building to those who were trapped. An investigation into the cause of the fire is ongoing.