The components are the sides S and W of a right triangle with SW = 5 km as the hypotenuse. It helps to sketch out these types problems.
Using the 60°south of west angle would make W adjacent and S opposite to the angle. using SOH CAH TOA
sin(60) = S/5
5*sin(60) = S
5*√(3)/2 = S
4.3 km = S