Let ${\mathrm{tr}}_2$ be the truncation functor that takes a simplicial set and restricts it to dimensions at most 2. Its right adjoint is the 2-coskeleton functor. NLab says that the nerve of a small category is a 2-coskeletal simplicial set.

In a category, composition is defined only if two morphisms abut. Precisely, the composite $g\circ f$ is defined if the target of $f$ is the source of $g$. This translates to saying the nerve of a category is a simplicial set such that every inner horn of a 2-simplex has a filler.

My question is: Does this extension condition characterize those 2-coskeletal simplicial sets that is a nerve of a category? If not, is there a necessary and sufficient condition?

EDIT: Thanks Tyler for your comment. Can we identify a "category" with a "simplicial set truncated in dimension 2 such that every inner horn of a 2-simplex has a unique filler"? How does this account for the associativity of composition?