An equivalence criterion for 3-manifolds