Second-half recovery secures important Scottish Cup win for Tynecastle side at Highland League leaders