According to Plutarch, When Pericles heard that Anaxagoras was starving himself, Pericles approached Anaxagoras begging him to stop starving himself since if Anaxagoras were to die,Pericles will lose his counselor. It is at that point that Anaxagoras uttered " “even those who have occasion for a lamp supply it with oil.” But I cannot understand what Anaxagoras meant by those words.
See V.Azoulay, Pericles of Athens, (French ed., 2010), page 90:
Peicles' public commitments were so absorbing that he could not always spare the time to devote to his friends, even the closest of them. According to an anecdote related by Plutarch, Anaxagoras of Clazomenae reproached him for this neglect of the elementary rules of friendship:
“At a time when Pericles was absorbed in business, Anaxagoras lay on his couch all neglected, in his old age, starving himself to death, [...] and when the matter came to the ears of Pericles, he was struck with dismay and ran at once to the poor man and besought him most fervently to live, bewailing not so much that great teacher’s lot as his own, were he now to be bereft of such a counsellor in the conduct of the city. Then Anaxagoras — so the story goes — unmuffled his head and said to him, ‘Pericles, even those who need a lamp pour oil therein’”.
The sense is: a friendship must be nourished.