For any two density matrices, no matter where they originated, the SWAP test can be used to calculate the desired quantity.
Let's write this explicitly. We take three modes, one for the control that I'll initialize in $|0\rangle$ and one each for $\rho_1$ and $\rho_2$, no matter where these density matrices originated (they can be unitarily evolved from something, the result of a partial trace from something else aka a subsystem of a larger system, etc.). Start with a Hadamard gate on the first state; now the overall state is
$$\varrho=|+\rangle\langle+|\otimes \rho_1\otimes\rho_2.$$ We'll need an eigendecomposition of the density matrices if we want to easily inspect the action of the SWAP gate, so we write, without loss of generality:
$$\varrho=|+\rangle\langle+|\otimes \sum_m\psi_m |\psi_m\rangle\langle \psi_m|\otimes \sum_n\phi_n |\phi_n\rangle\langle \phi_n|.$$ Now the SWAP gate is defined by its action
$$S(\alpha|0\rangle+\beta|1\rangle)\otimes|\psi\rangle\otimes|\phi\rangle=(\alpha|0\rangle\otimes|\psi\rangle\otimes|\phi\rangle+\beta|1\rangle\otimes|\phi\rangle\otimes|\psi\rangle).$$ Acting on our state in question gives u
\begin{align}
S\varrho S^\dagger=\frac{1}{2}\sum_{mn}\psi_m\phi_n \left(|0,\psi_m,\phi_n\rangle\langle 0,\psi_m,\phi_n|+|0,\psi_m,\phi_n\rangle\langle 1,\phi_n,\psi_m|+|1,\phi_n,\psi_m\rangle\langle 0,\psi_m,\phi_n|+|1,\phi_n,\psi_m\rangle\langle 1,\phi_n,\psi_m|\right).
\end{align} To do the measurement, we apply another Hadamard gate to the control qubit before measuring it in the computational basis:
\begin{align}
(H\otimes\mathbb{I}\otimes\mathbb{I})(S\varrho S^\dagger
(H\otimes\mathbb{I}\otimes\mathbb{I})^\dagger=\frac{1}{4}\sum_{mn}\psi_m\phi_n \left(|0,\psi_m,\phi_n\rangle\langle 0,\psi_m,\phi_n|+|1,\psi_m,\phi_n\rangle\langle 0,\psi_m,\phi_n|+|0,\psi_m,\phi_n\rangle\langle 1,\psi_m,\phi_n|+|1,\psi_m,\phi_n\rangle\langle 1,\psi_m,\phi_n| \right.\\
\left.
-|0,\psi_m,\phi_n\rangle\langle 1,\phi_n,\psi_m|-|1,\psi_m,\phi_n\rangle\langle 1,\phi_n,\psi_m|+|0,\psi_m,\phi_n\rangle\langle 0,\phi_n,\psi_m|+|1,\psi_m,\phi_n\rangle\langle 0,\phi_n,\psi_m|\right.\\
\left.-|1,\phi_n,\psi_m\rangle\langle 0,\psi_m,\phi_n|-|1,\phi_n,\psi_m\rangle\langle 1,\psi_m,\phi_n|+|0,\phi_n,\psi_m\rangle\langle 0,\psi_m,\phi_n|+|0,\phi_n,\psi_m\rangle\langle 1,\psi_m,\phi_n|\right.\\
\left.+|1,\phi_n,\psi_m\rangle\langle 1,\phi_n,\psi_m|-|0,\phi_n,\psi_m\rangle\langle 1,\phi_n,\psi_m|-|1,\phi_n,\psi_m\rangle\langle 0,\phi_n,\psi_m|+|0,\phi_n,\psi_m\rangle\langle 0,\phi_n,\psi_m|\right).
\end{align} Instead of collecting terms, we just look at the probability of measuring $|0\rangle$ for the control:
\begin{align}
\langle 0|(H\otimes\mathbb{I}\otimes\mathbb{I})(S\varrho S^\dagger
(H\otimes\mathbb{I}\otimes\mathbb{I})^\dagger|0\rangle_c=&\frac{1}{4}\sum_{mn}\psi_m\phi_n \mathrm{Tr}\left(|\psi_m,\phi_n\rangle\langle \psi_m,\phi_n|+|\psi_m,\phi_n\rangle\langle \phi_n,\psi_m|+|\phi_n,\psi_m\rangle\langle \psi_m,\phi_n|+|\phi_n,\psi_m\rangle\langle \phi_n,\psi_m|\right)\\
=&\frac{1}{2}\sum_{mn}\psi_m\phi_n \left(1+|\langle\psi_m|\phi_n\rangle|^2\right)\\
=&\frac{1}{2}+\frac{1}{2}\sum_{mn}\psi_m\phi_n |\langle\psi_m|\phi_n\rangle|^2\\
=&\frac{1}{2}+\frac{1}{2}\mathrm{Tr}(\rho_1\rho_2).
\end{align} Of course, one finds the alternate result $|1\rangle$ with complementary probability $\frac{1}{2}-\frac{1}{2}\mathrm{Tr}(\rho_1\rho_2)$.
Note that this final measurement incorporates the act of ignoring all external systems, so it works with reduced density matrices or regular density matrices. The main part is that the SWAP operator must only act on the modes of interest: you must ensure that the SWAP only swaps the degrees of freedom that you have not traced out. Otherwise, no changes are required to implement this test.