We consider a singular holomorphic foliation F defined near a compact curve C of a complex surface. Under some hypothesis on (F, C) we prove that there exists a system of tubular neighborhoods U of a curve D containing C such that every leaf L of F |(U \D) is incompressible in U \ D. We also construct a representation of the fundamental group of the complementary of D into a suitable automorphism group, which allows to state the topological classification of the germ of (F, D), under the additional but generic dynamical hypothesis of transverse rigidity. In particular, we show that every topological conjugation between such germs of holomorphic foliations can be deformed to extend to the exceptional divisor of their reductions of singularities.