The method there is you will use the material function “Transform to Z Vector” with the input Z vector being the stored normal map of the underlying terrain. The main material needs to be in world space normals for that to work. And remember you only do the tranform to zvector on the normal for the underlying. For the rest of the mesh, if its tangent space normals you need to do transform tangent->world (regular transform not position transform node). If they are worldspace normals such as from world aligned textures you can plug those in raw.
You could also attempt to use the distance field gradient to derive that normal but you will need to disable distance fields on the top mesh in question. There are some tweaks you can use to sort of get an intersection without disabling the top DF but they are pretty tricky to get right.