I really have no idea how to achieve this
In 3D space we have any plane that is perpendicular to the X-Z plane and through the Y-axis (the white colored plane in the image). Then a sine curve, of constant amplitude and period, is drawn on that plane and passes through the origin.
What I want is to find the equation of that curve that depends only on x and z, that is: y = f(x,z).
To project a curve $y = f(x)$ to an arbitrary plane in 3D, first define the unit axis vectors. Let $\hat{u}$ be the vector in 3D that is one unit long in the direction of the 2D $x$ axis, and $\hat{v}$ be the vector in 3D that is one unit long in the direction of the 2D $y$ axis. Finally, let $\vec{o}$ be the 3D vector describing the origin of the 2D coordinate system.
Then, point $(x, y)$ on the 2D plane corresponds to point $\vec{p}$ in 3D, $$\vec{p}(x, y) = \vec{o} + x \hat{u} + y \hat{v}$$ and since $y = f(x)$, the curve in 3D is $$\vec{p}(x) = \vec{o} + x \hat{u} + f(x) \hat{v}$$
If we use $\vec{p} = (X, Y, Z)$, i.e. uppercase letters for 3D coordinates, and lowercase letters $x$ and $y$ for the 2D coordinates, then $$\left\lbrace \begin{aligned} X &= o_x + x u_x + f(x) v_x \\ Y &= o_y + x u_y + f(x) v_y \\ Z &= o_z + x u_z + f(x) v_z \\ \end{aligned} \right.$$
If I understood OP correctly, then $v_x = v_z = 0$, i.e. the 2D $y$ axis is in the same direction as the 3D $Y$ axis. In that case, we have $$\left\lbrace \begin{aligned} X &= o_x + x u_x \\ Y &= o_y + x u_y + f(x) v_y \\ Z &= o_z + x u_z \\ \end{aligned} \right.$$ and we can solve for $x$ using $X$ or $Z$. (In practice, you compare $\lvert u_x \rvert$ and $\lvert u_z \rvert$, and pick $X$ if the former is greater, and $Z$ if the latter is greater, to minimize numerical error.)
Picking $X$, we get $$x = \frac{X - o_x}{u_x}$$ and therefore $$\left\lbrace \begin{aligned} Y(X) &= o_y + \frac{X - o_x}{u_x} u_y + f\left(\frac{X - o_x}{u_x}\right) v_y \\ Z(X) &= o_z + \frac{X - o_x}{u_x} u_z \\ \end{aligned} \right . \tag{1}\label{ANS1}$$ If we pick Z instead, then $$\left\lbrace \begin{aligned} X(Z) &= o_x + \frac{Z - o_z}{u_z} u_x \\ Y(Z) &= o_y + \frac{Z - o_z}{u_z} u_y + f\left(\frac{Z - o_z}{u_z}\right) v_y \\ \end{aligned} \right . \tag{2}\label{ANS2}$$ Note that in both cases you get two equations, one for each unknown coordinate.