A necessary and sufficient condition for the stabilisation of a matrix and its principal submatrices