I might try to improve my answer later this day. For the moment, a sufficient condition was given by Pedicchio and BorceruxBorceux in A characterization of quasi-toposes, JoA 139 (1991).
Prop 4.1. If $C$ is an elementary topos, then $\mathsf{Lex}(C^\circ,\mathsf{Set})$ is locally cartesian closed.