Inverness lost ground in the race for a top-three place as they were held to a 2-2 draw by lowly St Mirren at the Caledonian Stadium.