it depends on what you're "dividing by".

if you are dividing by a number that is co-prime to your modulus, then what you are really doing is finding the inverse of the denominator (mod n).

in this case, you are dividing by 5, and (5,26) = 1. thus 5 is invertible (mod 26).

it turns out that 1/5 (mod 26) is 21: 5*21 = 105 = 4(26) + 1.

so 16/5 (mod 26) is 16*21 = 336 = 24 (mod 26). no trial-and-error is required here, you just calculate (i - 2)(21), and reduce it mod 26.