Let $\mathcal{C}$ be a (small) category, and $S \subset \mathcal{C}$ a class of morphisms in $\mathcal{C}$. Suppose $f$ is a morphism in $\mathcal{C}$ that becomes an isomorphism in the localization $S^{-1}\mathcal{C}$. Suppose moreover that $S$ satisfies the two-out-of-three property (i.e. in a composition, if two of the terms belong to $S$, then so does the third) and contains all isomorphisms in $\mathcal{C}$. When can we conclude that $f \in S$ itself?
In the special case that I'm considering, $S$ is the class of weak equivalences in a model category $\mathcal{C}$. In this case it is true (and follows from the alternative description of the homotopy category) that an isomorphism in the homotopy category is a weak equivalence, but the proof involves some manipulations. I am curious if a simpler approach exists.