Observe that any irreducible component of $X$ dominates $Y$ (Lemma \ref{lemma-flat-inverse-image-dimension}) and hence the composition $g \circ f|_{X'}$ is defined (Morphisms of Spaces, Section \ref{spaces-morphisms-section-rational-maps}). We will reduce this to the case of schemes. Choose a scheme $V$ and a surjective \'etale morphism $V \to Y$. Choose a scheme $U$ and a surjective \'etale morphism $U \to V \times_Y X$. Picture $$ \xymatrix{ U \ar[r]_a \ar[d]_h & X \ar[d]^f \\ V \ar[r]^b & Y } $$ Since $a$ is surjective and \'etale it follows from Lemma \ref{lemma-etale-pullback} that it suffices to prove the equality of cycles after pulling back by $a$. We can use Lemma \ref{lemma-etale-pullback-principal-divisor} to write $$ b^*\text{div}_Y(g) = \sum (V' \to V)_*\text{div}_{V'}(g \circ b|_{V'}) $$ where the sum is over the irreducible components $V'$ of $V$. Using Lemma \ref{lemma-flat-pullback-proper-pushforward} we find $$ h^*b^*\text{div}_Y(g) = \sum (V' \times_V U \to U)_*(h')^*\text{div}_{V'}(g \circ b|_{V'}) $$ where $h' : V' \times_V U \to V'$ is the projection. We may apply the lemma in the case of schemes (Chow Homology, Lemma \ref{chow-lemma-prepare-flat-pullback-rational-equivalence}) to the morphism $h' : V' \times_V U \to V'$ to see that we have $$ (h')^*\text{div}_{V'}(g \circ b|_{V'}) = \sum m_{U', V' \times_V U} (U' \to V' \times_V U)_*\text{div}_{U'}(g \circ b|_{V'} \circ h'|_{U'}) $$ where the sum is over the irreducible components $U'$ of $V' \times_V U$. Each $U'$ occurring in this sum is an irreducible component of $U$ and conversely every irreducible component $U'$ of $U$ is an irreducible component of $V' \times_V U$ for a unique irreducible component $V' \subset V$. Given an irreducible component $U' \subset U$, denote $\overline{a(U')} \subset X$ the ``image'' in $X$ (Lemma \ref{lemma-proper-image}); this is an irreducible component of $X$ for example by Lemma \ref{lemma-flat-inverse-image-dimension}. The muplticity $m_{U', V' \times_V U}$ is equal to the multiplicity $m_{\overline{a(U')}, X}$. This follows from the equality $h^*a^*[Y] = b^*f^*[Y]$ (Lemma \ref{lemma-compose-flat-pullback}), the definitions, and Lemma \ref{lemma-etale-pullback}. Combining all of what we just said we obtain $$ a^*f^*\text{div}_Y(g) = h^*b^*\text{div}_Y(g) = \sum m_{\overline{a(U')}, X} (U' \to U)_*\text{div}_{U'}(g \circ (f \circ a)|_{U'}) $$ Next, we analyze what happens with the right hand side of the formula in the statement of the lemma if we pullback by $a$. First, we use Lemma \ref{lemma-flat-pullback-proper-pushforward} to get $$ a^*\sum m_{X', X} (X' \to X)_*\text{div}_{X'}(g \circ f|_{X'}) = \sum m_{X', X} (X' \times_X U \to U)_*(a')^*\text{div}_{X'}(g \circ f|_{X'}) $$ where $a' : X' \times_X U \to X'$ is the projection. By Lemma \ref{lemma-etale-pullback-principal-divisor} we get $$ (a')^*\text{div}_{X'}(g \circ f|_{X'}) = \sum (U' \to X' \times_X U)_*\text{div}_{U'}(g \circ (f \circ a)|_{U'}) $$ where the sum is over the irreducible components $U'$ of $X' \times_X U$. These $U'$ are irreducible components of $U$ and in fact are exactly the irreducible components of $U$ such that $\overline{a(U')} = X'$. Comparing with what we obtained above we conclude.