1570s, "affinity between certain things," from Middle French sympathie, from Late Latin sympathia "community of feeling, sympathy," from Greek sympatheia, from sympathes "having a fellow feeling, affected by like feelings," from syn- "together" (see syn-) + pathos "feeling" (see pathos).
In English, almost a magical notion at first; e.g. 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" is first attested 1660s. An Old English loan-translation of sympathy was efensargung.