Inverness Caley held out to earn a 1-0 victory over St Johnstone and maintain their hopes of clinching a place in Europe next season.