  Baryon number violation is a key ingredient of baryogenesis. It has been
hypothesized that there could also be a parity-conjugated copy of the standard
model particles, called mirror particles. The existence of such a mirror
universe has specific testable implications, especially in the domain of
neutral particle oscillation, viz. the baryon number violating neutron to
mirror-neutron ($n-n'$) oscillation. Consequently, there were many experiments
that have searched for $n-n'$ oscillation, and imposed constraints upon the
parameters that describe it. All the previous efforts searched for $n-n'$
oscillation by comparing the relative number of ultracold neutrons that survive
after a period of storage for one or both of the two cases: (i) comparison of
zero applied magnetic field to a non-zero applied magnetic field, and (ii)
comparison where the orientation of the applied magnetic field was reversed.
However, $n-n'$ oscillations also lead to variations in the precession
frequency of polarized neutrons upon flipping the direction of the applied
magnetic field. For the first time, we used the data from the latest search for
the neutron electric dipole moment [Phys. Rev. Lett. 124, 081803 (2020)] to
constrain $n-n'$ oscillation. After compensating for the systematic effects
that affect the ratio of precession frequencies of ultracold neutrons and
cohabiting $^{199}$Hg-atoms, chief among which was due to their motion in
non-uniform magnetic field, we constrained any further perturbations due to
$n-n'$ oscillation. We thereby provide a lower limit on the $n-n'$ oscillation
time constant of $\tau_{nn'}/\sqrt{|\cos(\beta)|} > 5.7~$s,
$0.36~\mu$T'$<B'<1.01~\mu$T' (95\% C.L.), where $\beta$ is the angle between
the applied magnetic field and the ambient mirror magnetic field. This
constraint is the best available in the range of $0.36~\mu$T'$<B'<0.40~\mu$T'.
