TheI believe the algebraic variant of what you are asking is the property of canonical completionsubgroup separability of Haglund and Wisein groups ("Special Cube Complexes", GAFAwhich is very well studied). Recall that a group, 2008$G$, see Section 6) is subgroup separable if for any finitely generated group, $\Delta \leq G$ and any $g \notin \Delta$, there exists a great strengtheningfinite index subgroup $H \leq G$ such that $g \notin \Delta H$.
You cannot expect to generalize subgroup separability of Stallings Theoremfree groups to arbitrary free products of freely indecomposable groups, as subgroup separability implies residual finiteness (I wroteand any infinite simple group is not residually finite). However, free groups and, more generally, surface groups are known to be subgroup separable. In fact, any group that contains a quantified versionsubgroup of thisfinite index that is subgroup separable is subgroup separable. For the proofs of the aforementioned facts see Peter Scott's Subgroups of surface groups are almost geometric from JLMS, 1978. The main ideas in athis paper, available on were greatly generalized: the arXiv, with Mark Hagen and Priyam Patelmodern form of this is now called "Residual finiteness growththe canonical completion of virtually special groups")Haglund and Wise. See Section 6 in Special Cube Complexes from GAFA, 2008.