Let's fix the probability spaces $(\Omega,\mathcal{F},P)$ and $(\Omega',\mathcal{F}',P')$, where $\mathcal{F}$ is a sigma algebra of $\Omega$ and $\mathcal{F}'$ is a sigma algebra of $\Omega'$.
Consider $(E_1,\varepsilon_1),\dots,(E_n,\varepsilon_n)$ to be measurable spaces (namely $\varepsilon_i$ is a sigma algebra of $E_i$).
Now let's fix $X_1\colon \Omega \to E_1,\dots,X_n\colon \Omega \to E_n$ random variables such that $X_i$ is $(\mathcal{F},\varepsilon_i)$-measurable with $i=1,\dots,n$, (namely $\forall \,A \in \varepsilon_i \quad X_i^{-1}(A) \in \mathcal{F}$).
Now fix $Y_1\colon \Omega' \to E_1,\dots,Y_n\colon \Omega' \to E_n$ random variables such that $Y_i$ is $(\mathcal{F}',\varepsilon_i)$-measurable.
Moreover suppose that $X_1,\dots,X_n$ are independent (namely given $A_1 \in \varepsilon_1,\dots,A_n \in \varepsilon_n$ then $P(X_1 \in A_1,\dots,X_n \in A_n)=\prod_{i=1}^n P(X_i \in A_i)$).
Suppose even that given $A_1 \in \varepsilon_1,\dots,A_n \in \varepsilon_n$ then $P(X_1 \in A_1,\dots,X_n \in A_n)=P'(Y_1 \in A_1,\dots,Y_n \in A_n)$.
Then my question: is it true that $Y_1,\dots,Y_n$ are independent too?
I already know that when $X_1,\dots,X_n$ and $Y_1,\dots,Y_n$ are discrete (namely their image is at most countable) and real (endowed with Borel sigma algebra), then this result holds. But is it true even in this general context?
Thank you!
EDIT:
I've thought about this and I think that the answer is not in general.