By the Skin of their Teeth
This phrase means to achieve something by a narrow margin, to only just succeed.
Example: In 2008 in the Premier League Wigan Athletic stayed in the top flight by the skin of their teeth, they stayed up with a goal difference of one better than Sheffield United.