Erdős conjectured that every n-vertex triangle-free graph contains a subset of ⌊n/2⌋ vertices that spans at most n2/50 edges. Extending a recent result of Norin and Yepremyan, we confirm this for graphs homomorphic to so-called Andrásfai graphs. As a consequence, Erdős’ conjecture holds for every triangle-free graph G with minimum degree δ(G)>10n/29 and if χ(G)≤3 the degree condition can be relaxed to δ(G)>n/3. In fact, we obtain a more general result for graphs of higher odd-girth.