Edinburgh Accies showed fighting spirit to defeat Glasgow Hawks in an Arnold Clark Premiership basement battle.