I have the following question.

Suppose I have a simplicial set. Is there a way to detect if it actually is isomorphic to a nerve of a groupoid?

I've seen the fact that if you have a nerve $\mathcal{N}$ of a groupoid $\mathcal{G}$ then all homotopy groups $\pi_n(\mathcal{N})$ for $n\geq 2$ must vanish. Is the converse true? I don't think so, but I don't know how to check that.

Though I would like some other way of detecting nerves of groupoids. The reason is, I have a simplicial set, and I want to make a conclusion about its homotopy groups using the fact that it is a nerve of a groupoid (I don't know this fact yet).

I am a complete novice in the field, so my question might be very easy.

Thank you very much for your help!