Necessity teaches wisdom even to the unlearned.
χρεία διδάσκει, κἂν ἄμουσος ᾖ, σοφόν.
Original text (Ancient Greek)
Notes from Wikiquote
Compare Euripides, frg. 715.2 TrGF (tr. W. F. H. King, 1904):
χρεία διδάσκει, κἂν βραδύς τις ᾖ, σοφόν.
Necessity will put wits even into the dullest heads.