We investigate the localization of two incoherent point sources with arbitrary angular and axial separations in the paraxial approximation. By using quantum metrology techniques, we show that a simultaneous estimation of the two separations is achievable by a single quantum measurement, with a precision saturating the ultimate limit stemming from the quantum Cramér-Rao bound. Such a precision is not degraded in the subwavelength regime, thus overcoming the traditional limitations of classical direct imaging derived from Rayleigh’s criterion. Our results are qualitatively independent of the point spread function of the imaging system, and quantitatively illustrated in detail for the Gaussian instance. This analysis may have relevant applications in three-dimensional surface measurements.