In zsh, you can get a sorted list of the keys of an associated array (${(kOn)A}) or of the values (${(On)A}) but not directly a list of keys from the sorted list of values (AFAIK), but you could do something like:
typeset -A assoc
assoc=(
192.168.2.2 5
192.168.3.2 1
192.168.1.1 9
192.168.8.1 9
)
ordered_keys=()
for v ("${(@nO)assoc}") ordered_keys+=("${(@k)assoc[(eR)$v]}")
That is, order (O) the list of values ($assoc) numerically (n) and for each value, add the matching key(s) (e for exact match, R to get the reverse list based on value, not key) and add that to the ordered_keys array.
See info zsh flags on your system¹ (or the same online for the latest version of zsh) for details about those parameter expansion flags.
¹ Note on some systems, you'll also need to install a zsh-doc package to get the documentation in info format.