A version of this claim is present on Wikipedia:
Experiments have shown rats will forgo food to the point of starvation
in order to work for brain stimulation or intravenous cocaine when
both food and stimulation are offered concurrently for a limited time
Notice "Experiments" plural. The sources apparently are:
Routtenberg & Lindy (1965):
10 rats with electrodes aimed at medial forebrain bundle-posterior
hypothalamus (MFB) ... All septal Ss and 4 hypothalamic Ss maintained
their weight on this regimen. The other 6 hypothalamic Ss essentially
ignored food, spending most of the session self-stimulating, and
"self-starved." Self-starving Ss had their electrodes extensively in
MFB while surviving hypothalamic Ss had their electrodes in more
Bozarth & Wise (1985):
Laboratory rats were given unlimited access to intravenous cocaine
hydrochloride or heroin hydrochloride. ... The mortality rate for 30
days of continuous testing was 36% for animals self-administering
heroin and 90% for those self-administering cocaine.
As noted in other experiments, particular conditions are needed to induce such self-starvation in rats.
By the way, it's actually much easier to get a rat to self-starve: Just give them an activity wheel.
A large number of experiments were run in the 1950s and early 1960s to
test this theory, as reviewed in Bolles’ influential 1967 book, Theory
of Motivation. Many of these experiments measured rates of running as
a function of various kinds of food deprivation schedules and, when
the experiments were reported, the authors noted—often only in a
footnote—that a surprisingly large proportion of rats died in the
course of the experiment.