We compare on lens spaces the values of two topological invariants of three-manifolds, both built from a finite group G and a three-cocycle ω, which we conjectured to be equal up to a normalization. The first invariant is defined by triangulation—it is the partition function of the Dijkgraaf-Witten topological field theory—and the second one by surgery, using a quasi-Hopf algebra. When G is a cyclic group, we show that the first invariant reduces to a Gauss sum. Some identities satisfied by three-cocycles are derived in an appendix.