When the structures $M_1$ and $M_2$ are countable and the language is countable and you only want to compare the elementary equivalence between models of set theory having the same countable ordinals, then your argument is correct. Satisfying a given formula is uniformly $\Delta_1$, since you can quantify over the (unique) Tarskian satisfaction predicate, and so saying that the two structures satisfy exactly the same sentences is $\Pi^1_1(M_1,M_2)$ and hence absolute between models of set theory having the same countable ordinals.

In the most general case, however, the statement is not correct. To see this, suppose that we have an $\omega$-nonstandard model of set theory $W$, and inside $W$, we can have two structures $M_1$ and $M_2$ that have the same $\Sigma_n$ theory, for some nonstandard $n$, but are not fully elementary equivalent inside $W$. We can easily arrange this situation by the compactness theorem, or via ultrapowers, etc. Meanwhile, because $n$ was nonstandard, in the set-theoretic background universe $V$, or indeed in any $\omega$-standard model of set theory containing $M_1$ and $M_2$, the structures will be elementarily equivalent, since the disagreement didn't appear until a nonstandard stage. So different models of set theory can disagree about whether two fixed structures are elementarily equivalent.