Topology of singular holomorphic foliations along a compact divisor