Short answer
Yes, by the Buddhist texts. The Long Discourses say each of the last seven Buddhas was born a brahmin or an aristocrat, the two highest classes of ancient India. The Nidanakatha, the commentary's introduction to the Jataka, the stories of the Buddha's past lives, makes it a rule. Buddhas are never born to the merchants or the labourers, only to whichever of the top two is most honoured at the time. In another discourse, after a young brahmin insults his clan three times, the Buddha replies that the young man descends from a slave girl. He then argues that aristocrats are superior to brahmins. Yet Buddhists often say the Buddha rejected caste. The Qur'an says the most honoured with God (﷾) is the most righteous.
Full explanation
Seven Buddhas, two classes
In the Great Discourse on Traces Left Behind, the Buddha names six Buddhas who came before him. Three were born aristocrats, into aristocrat families. Three were born brahmins, into brahmin families. He himself, he says, was born an aristocrat. Ancient India divided people into four classes. There were the aristocrats (Kshatriyas, the warriors and rulers), the brahmins (the priests), the Vaisyas (the merchants and farmers) and the Sudras (the labourers and servants). Brahmins claimed the top place, while Buddhist texts put the aristocrats first.
“The Buddhas Vipassī, Sikhī, and Vessabhū were born as aristocrats into aristocrat families. The Buddhas Kakusandha, Koṇāgamana, and Kassapa were born as brahmins into brahmin families. I was born as an aristocrat into an aristocrat family.”
“"Worthy Gotama, there are these four classes: aristocrats, brahmins, peasants, and menials. Three of these classes—aristocrats, peasants, and menials—in fact succeed only when serving the brahmins. It is neither proper nor appropriate that the Sakyans—primitives that they are—don't honor, respect, revere, worship, or venerate brahmins." And that's how Ambaṭṭha denigrated the Sakyans with the word "primitives" for the third time.”
The rule in the Jataka's introduction
The Jataka tells the Buddha's past lives. Theravada Buddhists have read it for centuries with an introduction called the Nidanakatha, which is part of the commentary, not of the Pali canon. It tells how the future Buddha, in heaven, chose his birth. He thought: Buddhas are not born in the Vaisya caste, nor the Sudra caste, the merchants and the labourers. They are born brahmins or Kshatriyas, the aristocrats, whichever is then held in the highest repute. The Kshatriyas ruled at that time, so he chose to be born one.
“Then reflecting on the Tribe, he thought, "The Buddhas are not born in the Vaisya caste, nor the Sudra caste; but either in the Brahmana or in the Kshatriya caste, whichever is then held in the highest repute. The Kshatriya caste is now predominant, I must be born in it, and Suddhodana the chief shall be my father." Thus he decided on the tribe.”
Superior by birth
In the discourse to Ambattha, a young brahmin three times calls the Buddha's clan, the Sakyans, primitives who do not honour brahmins. The Buddha asks about Ambattha's own clan. He tells him the Sakyans were the children of the masters, while Ambattha comes from the son of a slave girl of the Sakyans. When the other students then mocked Ambattha, the Buddha told them to stop, saying his ancestor was a great seer. Then, using the brahmins' own customs, he argues that aristocrats are higher and brahmins lower. Even when an aristocrat sinks to the very bottom, shaven and banished, he says, the aristocrats are still higher.
“"Worthy Gotama, there are these four classes: aristocrats, brahmins, peasants, and menials. Three of these classes—aristocrats, peasants, and menials—in fact succeed only when serving the brahmins. It is neither proper nor appropriate that the Sakyans—primitives that they are—don't honor, respect, revere, worship, or venerate brahmins." And that's how Ambaṭṭha denigrated the Sakyans with the word "primitives" for the third time.”
“"What is your clan, Ambaṭṭha?" "I am a Kaṇhāyana, worthy Gotama." "But, recollecting the ancient name and clan of your mother and father, the Sakyans were the children of the masters, while you're descended from the son of a slavegirl of the Sakyans."”
“"These young students put Ambaṭṭha down too much by calling him the son of a slavegirl. Why don't I get him out of this?" So the Buddha said to the young students, "Young students, please don't put Ambaṭṭha down too much by calling him the son of a slavegirl."”
“Young students, please don't put Ambaṭṭha down too much by calling him the son of a slavegirl. That Black Boy was an eminent seer.”
“And so, Ambaṭṭha, the aristocrats are superior and the brahmins inferior, whether comparing women with women or men with men.”
“At this point, Ambaṭṭha, that aristocrat has reached rock bottom, with head shaven, inflicted with a sack of ashes, and banished from city or nation. Yet still the aristocrats are superior and the brahmins inferior.”
Not by birth, but by deeds
Elsewhere the Buddha says that no one is low or a brahmin by birth, but by deeds. And at the end of his talk with Ambattha, he approves a verse. Among those who judge by clan, it says, the aristocrat is best. But one who is complete in knowledge and conduct is first among gods and humans. He adds that in the highest knowledge and conduct, there is no talk of family or clan.
“You're not a lowlife by birth, nor by birth are you a brahmin. You're a lowlife by your deeds, by deeds you're a brahmin.”
“That verse was well sung by the Divinity Sanaṅkumāra, not poorly sung; well spoken, not poorly spoken, beneficial, not harmful, and it was approved by me. For I also say this: The aristocrat is best among people who take clan as the standard. But one accomplished in knowledge and conduct is first among gods and humans.”
“"Ambaṭṭha, in the supreme knowledge and conduct there is no discussion of genealogy or clan or pride—'You deserve me' or 'You don't deserve me.' Wherever there is giving and taking in marriage there is such discussion. Whoever is shackled to questions of genealogy or clan or pride, or to giving and taking in marriage, is far from the supreme knowledge and conduct. The realization of supreme knowledge and conduct occurs when you've given up such things."”
A teaching for all, a teacher only from the top
Buddhists are right to point to his words against caste, and his order took in people of every class. But by their own texts, the one who brings the teaching is never born into the lower classes. And the rule follows whichever class is most honoured at the time. In the talk with Ambattha, the Buddha himself ranks classes by birth. He answers an insult by pointing to a man's descent from a slave. By today's standards that is elitist: no one born into the lower castes can ever be a Buddha.
“Then reflecting on the Tribe, he thought, "The Buddhas are not born in the Vaisya caste, nor the Sudra caste; but either in the Brahmana or in the Kshatriya caste, whichever is then held in the highest repute. The Kshatriya caste is now predominant, I must be born in it, and Suddhodana the chief shall be my father." Thus he decided on the tribe.”
“The Buddhas Vipassī, Sikhī, and Vessabhū were born as aristocrats into aristocrat families. The Buddhas Kakusandha, Koṇāgamana, and Kassapa were born as brahmins into brahmin families. I was born as an aristocrat into an aristocrat family.”
“"What is your clan, Ambaṭṭha?" "I am a Kaṇhāyana, worthy Gotama." "But, recollecting the ancient name and clan of your mother and father, the Sakyans were the children of the masters, while you're descended from the son of a slavegirl of the Sakyans."”
“And so, Ambaṭṭha, the aristocrats are superior and the brahmins inferior, whether comparing women with women or men with men.”
The most honoured is the most righteous
The Qur'an says God (﷾) made people into nations and tribes so that they may know one another. And the most honoured in God's (﷾) sight is the one who is most righteous. The Prophet (ﷺ) said God (﷾) does not look at faces or wealth, but at hearts and deeds. A Companion once insulted a man and shamed him over his mother. The Prophet (ﷺ) told him he still had the ways of the days of ignorance. Umar, of the noble tribe of Quraysh, called Bilal, a freed slave, "our master". The Meccans asked why the Qur'an was not sent to some leading man of the two cities. The Qur'an answered: is it they who share out the mercy of their Lord?
“O mankind! We created you from a single (pair) of a male and a female, and made you into nations and tribes, that ye may know each other (not that ye may despise (each other). Verily the most honoured of you in the sight of Allah is (he who is) the most righteous of you. And Allah has full knowledge and is well acquainted (with all things).”
Abu Huraira reports that the Prophet (ﷺ) said: Allah does not look at your faces or your wealth, but He looks at your hearts and your deeds.
Abu Dharr insulted a man and shamed him over his mother. The Prophet (ﷺ) told him he still had some of the ways of the Days of Ignorance. He said that their slaves are their brothers: they must feed them from what they eat, clothe them as they dress, and not load them beyond their strength, or else help them.
Jabir ibn Abdullah reports that Umar used to say: Abu Bakr is our master, and he set free our master, meaning Bilal.
“Also, they say: "Why is not this Qur'an sent down to some leading man in either of the two (chief) cities?" Is it they who would portion out the Mercy of thy Lord?”
The usual answers
Sahih Muslim 2276 — Kitab al-Fada'il (The Book of Virtues), hadith 2276
Wathila ibn al-Asqa' reports that the Prophet (ﷺ) said God chose Kinana from the descendants of Ishmael, chose Quraysh from Kinana, chose Banu Hashim from Quraysh, and chose him from Banu Hashim. In Sahih Muslim it stands under the heading on the merit of the Prophet's lineage.
Cited for
Islam also says God chose the Prophet (ﷺ) from the best lineage, Banu Hashim of Quraysh.
The response
That hadith is about the line God (﷾) chose for His Prophet (ﷺ), not the worth of each person in it. Abu Lahab, "Father of Flame", the Prophet's (ﷺ) own uncle of Banu Hashim, is condemned in the Qur'an by that name. It says the most honoured with God (﷾) is the most righteous, whatever his birth. The Prophet (ﷺ) put Usama, the son of his freed slave Zayd, in command of an army. The page "Isn't there caste among Muslims too?" sets this out.
Where it lands — In Islam, lineage gives no one honour with God (﷾). In the Jataka commentary's rule, the lower castes can never give the world a Buddha.
Perspectives
Theravada Buddhist
The Buddha rejected caste: no one is high or low by birth. Where his scriptures speak of class, they meet people where they are.
The Buddha rejected caste. He taught that no one is a brahmin or a lowlife by birth, only by deeds.
Rebuttal
He taught that, and it is to his credit. But his own texts still make the birth of a Buddha a matter of class. A Buddha is never born into the lower two classes, only into whichever of the top two is most honoured. And in the discourse to Ambattha, he argues from birth that aristocrats are higher.
In the discourse to Ambattha, the Buddha only turned the young brahmin's pride against him. And he ended with a verse saying that knowledge and conduct come first.
Rebuttal
He did more than turn the argument. He told a young man he came from a slave girl. And he said that even when an aristocrat sinks to the very bottom, the aristocrats are still higher. He then says the highest knowledge has no room for talk of clan. But that is about his path. He left his ranking of the classes standing. The Prophet (ﷺ) rebuked a Companion for shaming a man over his mother.
A Buddha is born into the most honoured class so that people will listen to him. That is a kindness to the world, not a judgement on the lower castes.
Rebuttal
Then the rule bends to whatever each age honours: a brahmin Buddha when brahmins are honoured, an aristocrat when aristocrats are. The merchants and labourers, who are most of the people, are shut out by birth, whatever their worth. The Qur'an rejects the Meccans' demand that revelation should come to a leading man of the two cities. It is not they who share out the mercy of their Lord.
The order took people of every class. The Buddha ordained Upali, a barber, before the Sakyan princes, so that they would bow to him as their senior.
Rebuttal
True, and to his credit. It was the princes themselves who asked for it, to humble their pride. The goal was open to all classes. The role of the one who brings it was not: the texts give it only to the top two.
What the texts say
The Pali discourses give the last seven Buddhas only the two top classes. The introduction to the Jataka makes that a rule. And in one discourse the Buddha ranks aristocrats above brahmins by birth.
The Great Discourse on Traces Left Behind says the last seven Buddhas were born aristocrats or brahmins.
The Nidanakatha says Buddhas are never born in the Vaisya or Sudra caste. They are born in whichever of the top two is most honoured at the time.
In the discourse to Ambattha, after Ambattha insults his clan, the Buddha says Ambattha comes from a slave girl's son. He says aristocrats are higher and brahmins lower.
The Islamic perspective
Birth gives no one honour with God (﷾). The most honoured is the most righteous, and God (﷾) looks at hearts and deeds.
The Qur'an says the most honoured with God (﷾) is the most righteous.
The Prophet (ﷺ) said God (﷾) does not look at faces or wealth, but at hearts and deeds. He rebuked a Companion for shaming a man over his mother.