1570s, "affinity between certain things," from Middle French sympathie (16c.) and directly from Late Latin sympathia "community of feeling, sympathy," from Greek sympatheia "fellow-feeling, community of feeling," from sympathes "having a fellow feeling, affected by like feelings," from assimilated form of syn- "together" (see syn-) + pathos "feeling" (from PIE root *kwent(h)- "to suffer").
In English, almost a magical notion at first; used in reference to medicines that heal wounds when applied to a cloth stained with blood from the wound. Meaning "conformity of feelings" is from 1590s; sense of "fellow feeling, compassion" is first attested c. 1600. An Old English loan-translation of sympathy was efensargung.