McKinstry's strike moved Accies out of the relegation play-off slot