Write $S=R+iI$, with $R,I\in M_n(\mathbb R)$, for the real and imaginary parts of $S$. By hypothesis, $AS=SB$ and so $AR=BR$ and $AI=IB$. Thus,
$$\forall t\in\mathbb R, A(R+tI)=(R+tI)B$$
We will be done once we show that there are $t\in\mathbb R$ such that $R+tI$ is invertible. This follows from the observation that
$$z\mapsto\det(R+zI)$$
is polynomial in $z$, nonzero since it is nonzero for $z=i$, and thus only has finitely many roots, and in particular, $(R+tI)$ is invertible for all but a finite number of $t\in\mathbb R$.
The same proof technique implies that if two matrices with coefficients in an infinite field $k(\subset K)$ are conjugate in some larger field $K$, then they are already conjugate in $k$.