let $Z(x,y)$ define a surface in 3D. It can also be written as $f(x, y, z) = Z(x, y) - z = 0$. Consider a level curve on the surface satisfying $Z(x,y) = c$. The curve is the intersection of the surface with some horizontal plane at $z = c$.
We can parametrize the curve as $r(t) = (x(t), y(t), z(t))$ with $z(t) = c$ from the level curve constraint. The gradient of the surface $Z$ at a point P is $(\partial Z/ \partial x, \partial Z/ \partial y, -1)$.
The gradient projected to the $x$-$y$ plane is thus $(\partial Z/ \partial x, \partial Z/ \partial y)$. Do we always have the projected gradient perpendicular to the level curve (also projected to $x$-$y$ plane) ($x(t)$, $y(t)$) at point $P$?
The answer is yes, orthogonality is preserved. The reason is as follows.
The gradient vector $ g = ( \dfrac{\partial Z}{\partial x}, \dfrac{\partial Z}{\partial y} , -1 ) $ is orthogonal to the surface $Z(x, y)$ at a given point $P$, so it is orthogonal to every curve on the surface that passes through $P$, and this means that if we parameterize the curve as
$ C(t) = (x(t), y(t), z(t) ) $
Then
$ g \cdot C'(t) = 0 $
where $C'(t)$ is the derivative with respect to the parameter $t$, and it is evaluated at the point $P$. We know that $C'(t)$ points along the tangent of the curve at the given point.
Now for a level curve , $z(t) = c $ a constant, so $z'(t) = 0 $, and therefore,
$ \left( \dfrac{\partial Z}{\partial x} \right) x'(t) + \left( \dfrac{\partial Z }{\partial y} \right) y'(t) = 0 $
But this is precisely the definition of orthogonality between the level curve and the projection of $g$ onto the $xy$ plane.