  We complete the analytic evaluation of the master integrals for the two-loop
non-planar box diagrams contributing to the top-pair production in the
quark-initiated channel, at next-to-next-to-leading order in QCD. The integrals
are determined from their differential equations, which are cast into a
canonical form using the Magnus exponential. The analytic expressions of the
Laurent series coefficients of the integrals are expressed as combinations of
generalized polylogarithms, which we validate with several numerical checks. We
discuss the analytic continuation of the planar and the non-planar master
integrals, which contribute to $q {\bar q} \to t {\bar t}$ in QCD, as well as
to the companion QED scattering processes $ e e \to \mu \mu$ and $e \mu \to e
\mu$.
