Let's say we want to determine the impact of $y_2$ on $y_1$, which are related as follows:
$$y_1 = f(y_2, x_1,e)$$
where
$$e = g(y_3,x_2, u_1), \space y_2 = h(y_4,x_3, u_2), \space y_3 = m(y_4, x_4,u_3)$$
and the $u$'s are the exogenous errors. Substituting, we have
$$y_1 = f(h(y_4,x_3, u_2),x_1, g(m(y_4, x_4,u_3),x_2, u_1))$$
We can see here that there is a correlation between $h$ and $g$ in $f$. Therefore, if we do not control for $y_3$ or $y_4$ in $f$, we would have endogeneity because then $h$ would be correlated with the error. Is this correct?
In other words, we are looking for $\frac{\partial f}{\partial h}$, but a change in $h$ without holding $y_3$ or $y_4$ constant in $g$ implies that our estimate of $\frac{\partial f}{\partial h}$ is not ceteris paribus; when we adjust $h$, we also adjust $g$.
My main concern here is whether it matters that the correlation between $y_2$ and the error in $f$ occurs through two functions: $g$ and $m$.