We exploit the synergy between low-resolution spectroscopy and photometric redshifts to study environmental effects on galaxy evolution in slitless spectroscopic surveys from space. As a test case, we consider the future Euclid Deep survey (~40deg$^2$), which combines a slitless spectroscopic survey limited at H$alpha$ flux $geq5times 10^{-17}$ erg cm$^{-2}$ s$^{-1}$ and a photometric survey limited in H-band ($Hleq26$). We use Euclid-like galaxy mock catalogues, in which we anchor the photometric redshifts to the 3D galaxy distribution of the available spectroscopic redshifts. We then estimate the local density contrast by counting objects in cylindrical cells with radius from 1 to 10 h$^{-1}$Mpc over the redshift range 0.9<z<1.8. We compare this density field with the one computed in a mock catalogue with the same depth as the Euclid Deep survey (H=26) but without redshift measurement errors. We find that our method successfully separates high from low density environments (the last from the first quintile of the density distribution), with higher efficiency at low redshift and large cell: the fraction of low density regions mistaken by high density peaks is <1% for all scales and redshifts explored, but for scales of 1 h$^{-1}$Mpc for which is a few percent. These results show that we can efficiently study environment in photometric samples if spectroscopic information is available for a smaller sample of objects that sparsely samples the same volume. We demonstrate that these studies are possible in the Euclid Deep survey, i.e. in a redshift range in which environmental effects are different from those observed in the local universe, hence providing new constraints for galaxy evolution models.