Small subgroup attack on Diffie-Hellman key exchange
Does it mean that i have to try all 5 values from S or the key can be
  indeed determined uniquely without performing exhaustive search on S?


In the general case, you cannot determine the key without performing exhaustive search on $S$.

Small subgroup attacks aim to make the key belong to a small subgroup to make the exhaustive search feasible in practice. So by definition, usual small subgroup attacks require exhaustive search.

I posted something about Small subgroup confinement attack on Diffie-Hellman to fully understand the functioning of the attack, maybe it can help you.