Forming a three dimensional view of the Universe is a long-standing goal of astronomical observations, and one that becomes increasingly difficult at high redshift. In this paper we discuss how tomography of the intergalactic medium (IGM) at $zsimeq 2.5$ can be used to estimate the redshifts of massive galaxies in a large volume of the Universe based on spectra of galaxies in their background. Our method is based on the fact that hierarchical structure formation leads to a strong dependence of the halo density on large-scale environment. A map of the latter can thus be used to refine our knowledge of the redshifts of halos and the galaxies and AGN which they host. We show that tomographic maps of the IGM at a resolution of $2.5,h^{-1}$Mpc can determine the redshifts of more than 90 per cent of massive galaxies with redshift uncertainty $Delta z/(1+z)=0.01$. Higher resolution maps allow such redshift estimation for lower mass galaxies and halos.