First of all, it may be worth noting that the word “toll” can be a verb meaning “to sound (a bell) by pulling a rope,” (Merriam-Webster). This usually applies to large bells, which tend to produce a deep sound, for example church bells, because those are the ones requiring a rope. This is etymologically unrelated to the other meaning of “toll,” to charge someone for passage. The name toll the dead does make it sound like they meant the bit about charging (else you’d be “tolling the bell,” not “the dead”), but the description of the spell clarifies—sorta. Likely, however, ambiguity is intentional and they intended for the title to have a double meaning. More on that in a bit.
Anyway, I can find no toll the dead spell in pre-5e D&D. I can state definitively that it was not a 4e warlock power or 3.5e warlock invocation, and that’s it for D&D’s pact-based warlocks, so if it exists anywhere it isn’t associated with older warlocks. For cleric or wizard—or anything else—the search is harder, because there’s a lot more material. I have consulted a 4e expert, who claims it isn’t to be found with any class there, having checked the Compendium. For 3e and 3.5e, I have found a couple of uses of “toll” in spell descriptions, that is, literally two, but neither is relevant.¹ Otherwise, I have done general searches for any kind of D&D material and turned up nothing but 5e sources. There is so much D&D material that it is impossible to be absolutely certain, but at this point, I feel pretty confident that any antecedent that might exist is as likely as not a coincidence rather than an ancestor of the 5e spell.
The closest I can find is the D&D 3e/3.5e necromancy spell death knell. A “death knell” is defined as the tolling of a bell at a funeral. But the effect is completely different (it tries to finish off a dying creature and grants the caster bonuses for doing so), and aside from the name of the spell, it makes no reference to bells or really any sounds at all. And I suspect many English speakers don’t actually know what a “knell” is and just know “death knell” as a stock phrase meaning something like “indication that someone has died.” I have seen it conflated with the idea of “death throes,” violent convulsions immediately prior to death, or a “death rattle,” sounds made immediately before death. It may not be obvious to many that it would be related to bells.
Even if death knell is related to toll the dead, and they just changed the name and effect, death knell doesn’t really provide any meaningful insight into what bells have to do with necromancy and dying.
However, the English-language association of bells with death and spirits is well-attested. Especially with the word “toll”—consistently, church bells “ring” for weddings but “toll” for funerals. As mentioned above, the bell-related meaning of “toll” is unrelated to the one about fees for passage, but I suspect this etymological coincidence is part of the association: it’s reminiscent of numerous myths (e.g. Charon) in which the dead must pay for passage to the afterlife. Certainly, as I said, the name toll the dead sounds more like charging someone than it sound like ringing a bell, so it seems likely that the D&D authors were trying to highlight that coincidence.
However, the particular idiom of a tolling bell signifying death probably comes from John Donne’s 1623 Meditation XVII, “never send to know² for whom the bell tolls, it tolls for thee,” where it is very clear from context that a funeral is being discussed. Meditation XVII, for the record, is also the origin of “no man is an island,” which is often used as the title of the poem—this was not an obscure work. Still, that particular line rose massively in prominence in 1940, when Ernest Hemingway quotes Donne for his novel For Whom the Bell Tolls. From there, “ask not² for whom the bell tolls” gradually gained cultural prominence and within a few decades had arguably become a cliche. For some prominent examples, Pink Floyd references “the tolling of the iron bell” in “Time” from 1973’s The Dark Side of the Moon, and Metallica’s 1984 album Ride the Lightning features a song entitled “For Whom the Bell Tolls.”
Also, aside from Donne and Hemingway, the traditional tools used in exorcism in the Catholic Church are book, bell, and candle. This comes up from time to time in fantasy, for example in Nethack (a computer game with tons of fantasy references, including D&D, and to which D&D has also made more than one reference). For another example, Garth Nix fuses the exorcist’s bell with the tolling bell in his popular Abhorsen novels, where the eponymous “good necromancer” psychopomp uses a set of bells to pacify, contain, and ultimately exorcise all manner of evil (or at least monstrous) dead.
In all cases, the tolling is not about damaging sound, as you would find with sonic or thunder damage. It may be loud, deep, and powerful, but that is simply because church bells are, to make sure they are heard far and wide—the listener in all cases heard a distant bell (except maybe in Abhorsen, but then those were also much smaller and quieter bells). Church bells do not injure people with their sonic vibrations (unless you’re actually within the bell tower without ear protection or something, maybe). The “damage” they do is instead caused by reminding the listener of their own mortality³—and necrotic damage is very appropriate for that.
One is about the cost of casting the spell (“The toll of [purity of seven thunders] on the shugenja is heavy.”), so that’s the other meaning of “toll” entirely. The other does have to do with bells (“The deep tolling of a bell echoes within the mind of your foe.”), but the spell in question is interminable echo and it has the sonic descriptor that the question expected toll the dead to have, so it doesn’t really offer much insight into why toll the dead lacks it or uses necrotic damage.
The quote is popularly remembered as “ask not” rather than “never send to know,” see this question on EL&U. Hemingway quotes it correctly in the epigraph for the novel, but nevertheless, incorrect quotations of Donne with “ask not” start appearing in newspapers and magazines shortly after the novel’s publication.
Both Donne and Hemingway actually had more nuance here: the theme here is, again, “no man is an island.” Thus, the funeral bell “tolls for thee” because everyone is so interconnected that the death of anyone is the death of a little piece of each one of us. This nuance is rarely remembered in the popular understanding of the phrase, however, where the metaphorical tolling is understood simply as foreshadowing one’s own funeral.