The Online Etymological Dictionary says (s.v. Leech sense 2):
obsolete for "physician," from Old English læce, probably from Old Danish læke, from Proto-Germanic lekjaz "enchanter, one who speaks magic words; healer, physician" (cf. Old Frisian letza, Old Saxon laki, Old Norse læknir, Old High German lahhi, Gothic lekeis "physician"), literally "one who counsels," perhaps connected with a root found in Celtic (cf. Irish liaig "charmer, exorcist, physician") and Slavic (cf. Serbo-Croatian lijekar, Polish lekarz), from PIE lep-agi "conjurer," from root *leg- "to collect," with derivatives meaning "to speak" (see lecture (n.)).
For sense development, cf. Old Church Slavonic baliji "doctor," originally "conjurer," related to Serbo-Croatian bajati "enchant, conjure;" Old Church Slavonic vrači, Russian vrač "doctor," related to Serbo-Croatian vrač "sorcerer, fortune-teller." The form merged with leech (n.1) in Middle English, apparently by folk etymology. In 17c., leech usually was applied only to veterinary practitioners. The fourth finger of the hand, in Old English, was læcfinger, translating Latin digitus medicus, Greek daktylus iatrikos, supposedly because a vein from that finger stretches straight to the heart.