Consider the anisotropic Navier-Stokes equations as well as the primitive equations. It is shown that the horizontal velocity of the solution to the anisotropic Navier-Stokes equations in a cylindrical domain of height $varepsilon $ with initial data $u_0=(v_0,w_0)in B^{2-2/p}_{q,p}$, $1/q+1/ple 1$ if $qge 2$ and $4/3q+2/3ple 1$ if $qle 2$, converges as $varepsilon to 0$ with convergence rate $mathcal{O} (varepsilon )$ to the horizontal velocity of the solution to the primitive equations with initial data $v_0$ with respect to the maximal-$L^p$-$L^q$-regularity norm. Since the difference of the corresponding vertical velocities remains bounded with respect to that norm, the convergence result yields a rigorous justification of the hydrostatic approximation in the primitive equations in this setting. It generalizes in particular a result by Li and Titi for the $L^2$-$L^2$-setting. The approach presented here does not rely on second order energy estimates but on maximal $L^p$-$L^q$-estimates for the heat equation.