Benzodiazepines are not directly ototoxic, and no research suggests they damage the cochlea. The mechanism by which they cause tinnitus is believed to involve downregulation or structural changes in GABA receptors in the dorsal cochlear nucleus (DCN) and possibly other areas of the brain.
Z-drugs like Ambien likely cause tinnitus through a similar mechanism. In most cases I've encountered, this effect is temporary and related to tolerance or withdrawal from these drugs.
There is limited evidence suggesting that abrupt or rapid discontinuation of these drugs could cause actual damage to the vestibular system. However, this risk can be minimized by tapering off the drug slowly.
Most people I've spoken with over the years who experienced tinnitus due to benzodiazepine use fall into two groups: those for whom the tinnitus was a short-term withdrawal effect that resolved within weeks, and those who took 1-3 years for the symptom to fade. Unfortunately, some people experience long-term tinnitus after discontinuing benzodiazepines or Z-drugs, but this is generally associated with long-term or high-dose use, cold-turkey withdrawals, or both.