You searched for: “non ignara mali
Non ignara mali, miseris succurrere disco. (Latin proverb)
Translation: "No stranger to misfortune myself, I learn to relieve the sufferings of others."

One rationale for helping people in distress, from Virgil's Aeneid. With these words, Dido, Queen of Carthage, greeted Aeneas and his companions, who were in exile.