To get to another city they needed a horse.
=They needed a horse so that they could get to another city.