  Consider a flow in $\mathbb{R}^3$ and let $K$ be the biggest invariant subset
of some compact region of interest $N \subseteq \mathbb{R}^3$. The set $K$ is
often not computable, but the way the flow crosses the boundary of $N$ can
provide indirect information about it. For example, classical tools such as
Wa\.{z}ewski's principle or the Poincar\'e-Hopf theorem can be used to detect
whether $K$ is nonempty or contains rest points, respectively. We present a
criterion that can establish whether $K$ has a nontrivial homology by looking
at the subset of the boundary of $N$ along which the flow is tangent to $N$. We
prove that the criterion is as sharp as possible with the information it uses
as an input. We also show that it is algorithmically checkable.
