As a castle term, a gangi is a staircase or a structure with a similar shape. They are said to be so called because the diagonally aligned flight of geese looks like a staircase.
They are installed so that defenders can move quickly from inside the castle to the turrets, ramparts and earthworks.