  Background radiation fields pervade the Universe, and above a certain energy
any $\gamma$-ray flux emitted by an extragalactic source should be attenuated
due to $e^+e^-$ pair production. The opacity could be alleviated if photons
oscillated into hypothetical axion-like particles (ALPs) in ambient magnetic
fields, leading to a $\gamma$-ray excess especially at high optical depths that
could be detected with imaging air Cherenkov telescopes (IACTs).
  Here, we introduce a method to search for such a signal in $\gamma$-ray data
and to estimate sensitivities for future observations. Different magnetic
fields close to the $\gamma$-ray source are taken into account in which photons
can convert into ALPs that then propagate unimpeded over cosmological distances
until they re-convert in the magnetic field of the Milky Way. Specifically, we
consider the coherent field at parsec scales in a blazar jet as well as the
turbulent field inside a galaxy cluster. For the latter, we explicitly derive
the transversal components of a magnetic field with gaussian turbulence which
are responsible for the photon-ALP mixing. To illustrate the method, we apply
it to a mock IACT array with characteristics similar to the Cherenkov Telescope
Array and investigate the dependence of the sensitivity to detect a
$\gamma$-ray excess on the magnetic-field parameters.
