You can only escape The Night Cage through a Gate. Gate tiles are drawn and placed like any other tile. The Gate is the only tile in the game that can be occupied by multiple Prisoners at the same time. To win, all Prisoners must gather on the same Gate, at the same time, with their Keys in hand to escape.
If all Gates are lost to The Darkness, there can be no escape and you lose the game.