Two non antipodal points on a sphere have a geodetic which is a segment of a great circle on that sphere. I'm trying to calculate the Euler angles that would rotate the "equator" great circle of the sphere (in my case, the normal to this plane is the y axis) into the great circle that intersects two points specified by two pairs of angles (theta and phi, latitude and longitude, whatever. Though, yes, latitude and theta aren't the same, I know.)
I feel like I've made it way more complicated that it needs to be and I'm stuck.
Let's assume that the sphere has radius 1, otherwise you will just need to normalize some distances. My reference frame has $\hat{z}$ pointing upwards. All angles with respect to this axis are called $\theta$. The angles in the $xy$ plane, from the $\hat{x}$ axis are $\phi$. The two points on the sphere then have coordinates $P_1=(\sin\theta_1\cos\phi_1,\sin\theta_1\sin\phi_1,\cos\theta_1)$ and $P_2=(\sin\theta_2\cos\phi_2,\sin\theta_2\sin\phi_2,\cos\theta_2)$. If the points are not antipodal, and are different, the plane that contains these points and the center of the sphere ($O=(0,0,0)$) form a plane. To get the normal to the plane, we choose two vectors $P_1O$ and $P_2O$, and the normal vector is given by the cross product. $$\vec{n}=(\sin\theta_1\sin\phi_1\cos\theta_2-\sin\theta_2\sin\phi_2\cos\theta_1,\\\cos\theta_1\sin\theta_2\cos\phi_2-\cos\theta_2\sin\theta_1\cos\phi_1,\\\sin\theta_1\cos\phi_1\sin\theta_2\sin\phi_2-\sin\theta_2\cos\phi_2\sin\theta_1\sin\phi_1)$$
For simplicity, call this $\vec{n}=(X,Y,Z)$. Note that $\vec{n}$ does not necessarily have unit length.
The initial equatorial plane is perpendicular to (0,0,1). To obtain $\hat{n}=\vec{n}/|\vec{n}|$, we need to rotate an angle $\theta$ away from the vertical, in the $zx$ plane (axis is $\hat{y}$), where $$\cos\theta=\frac{Z}{\sqrt{X^2+Y^2+Z^2}}$$, then rotate in the $xy$ plane (around $\hat{z}$) by an angle $\phi$ given by $$\tan\phi=\frac{Y}{X}$$
You can choose a different Euler convention, but the procedure is similar.
$\bf{Note:}$ I just realized that you wanted the y axis up, so you will need to change the letters.