Short answer
No. In one discourse the Buddha says people misrepresent him when they claim he knows everything at every moment. He tells them to say only that he has three special knowledges. Yet in another he calls himself "the knower of all". His own account says the knowledge that this was his last birth arose in him at his awakening. Yet another discourse has him announce those same words on the day he was born. The Qur'an, written down in the Prophet's (ﷺ) lifetime, fixed from the start what he was: a man who does not know the unseen.
Full explanation
Not always knowing everything
In one discourse, a wandering seeker named Vacchagotta speaks to the Buddha. He has heard that the Buddha claims to know and see everything, with knowledge always present to him, whether walking, standing, sleeping or awake. The Buddha says that people who say this misrepresent him with what is false. They should say only that he has the three knowledges. These are memory of past lives, sight of beings reborn by their deeds, and the ending of the inner stains that tie a person to rebirth.
“"Sir, I have heard this: 'The ascetic Gotama claims to be all-knowing and all-seeing, to know and see everything without exception, thus: "Knowledge and vision are constantly and continually present to me, while walking, standing, sleeping, and waking."' I trust those who say this repeat what the Buddha has said, and do not misrepresent him with an untruth? Is their explanation in line with the teaching? Are there any legitimate grounds for rebuttal and criticism?" "Vaccha, those who say this do not repeat what I have said. They misrepresent me with what is false and untrue."”
“'The ascetic Gotama has the three knowledges.' Answering like this you would repeat what I have said, and not misrepresent me with an untruth. You would explain in line with my teaching, and there would be no legitimate grounds for rebuttal and criticism.”
The knower of all
In his own account of his search, the Buddha tells of meeting an ascetic named Upaka on the road, soon after his awakening. He answers him in verse. He is the one who has overcome all, the knower of all. He has no teacher, and there is no one like him.
“I am the vanquisher of all, the knower of all, unsullied in the midst of all things. I've given up all, freed through the ending of craving. Since I know for myself, whose follower should I be? I have no tutor. There is no one like me.”
Not all at once
In another discourse King Pasenadi says he has heard that the Buddha teaches that no one can claim to be all-knowing. The Buddha says this misrepresents him. What he had said, he explains, is that no one will ever know all and see all at the same time.
“"I have heard, sir, that the ascetic Gotama says this: 'There is no ascetic or brahmin who will ever claim to be all-knowing and all-seeing, to know and see everything without exception: that is not possible.' I trust those who say this repeat what the Buddha has said, and do not misrepresent him with an untruth? Is their explanation in line with the teaching? Are there any legitimate grounds for rebuttal and criticism?" "Great king, those who say this do not repeat what I have said. They misrepresent me with what is false and untrue."”
“"Great king, I recall making this statement: 'There is no ascetic or brahmin who will ever know all and see all simultaneously: that is not possible.'"”
Omniscience as the goal
The Jataka stories of his past lives go further, as the commentary on the canon's Jataka verses tells them. Prince Vessantara gives away his children. He prays that he might become all-knowing, and cries that knowing all is a hundred thousand times dearer to him than his son. Here, being all-knowing is the very goal of becoming a Buddha. The page "Was Vessantara right to give away his children?" has the story.
“Then he took water in his waterpot, and calling the brahmin to come near, he poured out the water, praying that he might attain omniscience. "Dearer than my son a hundredfold, a thousandfold, a hundred thousandfold is omniscience!" he cried, making the earth resound, and to the brahmin he gave this precious gift of his children.”
Born knowing, or awakened to know?
In one discourse, Ananda says he heard from the Buddha what happened as soon as he was born. He stood, took seven strides and announced: this is my last rebirth; now there will be no more future lives. Yet in the Buddha's own account of his awakening, those are the very words of the knowledge that came to him. That was many years later.
“'As soon as he's born, the being intent on awakening stands firm with his own feet on the ground. Facing north, he takes seven strides with a white parasol held above him, surveys all quarters, and makes this dramatic proclamation: "I am the foremost in the world! I am the eldest in the world! I am the first in the world! This is my last rebirth; now there'll be no more future lives."'”
“Knowledge and vision arose in me: ‘My freedom is unshakable; this is my last rebirth; now there’ll be no more future lives.’”
Which picture is true?
The scriptures pull different ways. In one place he refuses to be called all-knowing at every moment. In another he calls himself the knower of all. In one place, the knowledge that this is his last birth comes at his awakening. In another, a newborn baby announces it. Buddhists bring these together with later explanations, such as that he knew whatever he turned his mind to. But the scriptures themselves do not settle it. And Buddhism has no word from God (﷾) to decide between them.
“"Sir, I have heard this: 'The ascetic Gotama claims to be all-knowing and all-seeing, to know and see everything without exception, thus: "Knowledge and vision are constantly and continually present to me, while walking, standing, sleeping, and waking."' I trust those who say this repeat what the Buddha has said, and do not misrepresent him with an untruth? Is their explanation in line with the teaching? Are there any legitimate grounds for rebuttal and criticism?" "Vaccha, those who say this do not repeat what I have said. They misrepresent me with what is false and untrue."”
“I am the vanquisher of all, the knower of all, unsullied in the midst of all things. I've given up all, freed through the ending of craving. Since I know for myself, whose follower should I be? I have no tutor. There is no one like me.”
“'As soon as he's born, the being intent on awakening stands firm with his own feet on the ground. Facing north, he takes seven strides with a white parasol held above him, surveys all quarters, and makes this dramatic proclamation: "I am the foremost in the world! I am the eldest in the world! I am the first in the world! This is my last rebirth; now there'll be no more future lives."'”
“Knowledge and vision arose in me: ‘My freedom is unshakable; this is my last rebirth; now there’ll be no more future lives.’”
A man who does not know the unseen
The Qur'an tells the Prophet (ﷺ) to say that he is a man like the people around him, to whom revelation comes. And it tells him to say that if he knew the unseen, no harm would have touched him. It says God (﷾) reveals what He wills of the unseen to a messenger He chooses. The Qur'an was written down as it came, in his lifetime, and gathered into one book soon after his death. So what Muslims say of him was fixed from the start.
“Say: "I am but a man like yourselves, (but) the inspiration has come to me, that your Allah is one Allah: whoever expects to meet his Lord, let him work righteousness, and, in the worship of his Lord, admit no one as partner.”
“Say: "I have no power over any good or harm to myself except as Allah willeth. If I had knowledge of the unseen, I should have multiplied all good, and no evil should have touched me: I am but a warner, and a bringer of glad tidings to those who have faith."”
“"He (alone) knows the Unseen, nor does He make any one acquainted with His Mysteries,- "Except a messenger whom He has chosen: and then He makes a band of watchers march before him and behind him,”
Zayd ibn Thabit reports that after many who knew the Qur'an by heart were killed at Yamama, Abu Bakr asked him to gather the Qur'an into one volume, reminding him that he used to write down the revelation for the Messenger of Allah. Zayd collected it from written pieces and from the memories of men, and the finished copy passed from Abu Bakr to Umar and then to Hafsa.
The usual answers
Qur'an 18:110 — Surat al-Kahf (The Cave), verse 110
“Say: "I am but a man like yourselves, (but) the inspiration has come to me, that your Allah is one Allah: whoever expects to meet his Lord, let him work righteousness, and, in the worship of his Lord, admit no one as partner.”
Cited for
Later Muslim stories also made the Prophet (ﷺ) into more than a man.
The response
The Qur'an was written down in his lifetime, and it fixes what he was: a man to whom revelation came, who does not know the unseen except what God (﷾) reveals. Any later story is judged by it. The Buddhist scriptures themselves hold both pictures of the Buddha.
Where it lands — Islam has a fixed standard from the Prophet's (ﷺ) lifetime. The Buddhist scriptures disagree with themselves.
Perspectives
Theravada Buddhist
The Buddha knew whatever he turned his mind to, and that is what omniscience means. One on his last birth knows it from the start, but must still walk the path.
The Buddha's omniscience means he could know anything he turned his mind to, not that everything was in his mind at once. So the texts agree.
Rebuttal
Even on that reading, he told Vacchagotta that people should speak of three knowledges, not knowledge of all things. And the scriptures do not agree on the word. Here he refuses to be called all-knowing at every moment. But to Upaka he calls himself the knower of all.
A person on his last birth can know it from the start. He still has to walk the path to awakening, as every Buddha does.
Rebuttal
The Buddha's own account says the knowledge that this was his last rebirth arose at his awakening. The newborn says the same words, word for word. If he knew it from birth, it did not first arise at his awakening.
What the scriptures say
In the Pali discourses, the Buddha refuses to be called all-knowing at every moment, yet calls himself the knower of all. In one discourse, the newborn announces that this is his last birth. In another, that knowledge comes at his awakening.
The Buddha told Vacchagotta that those who say he knows and sees everything at every moment misrepresent him.
To the ascetic Upaka he called himself the knower of all.
One discourse says the newborn announced that this was his last rebirth. In another the Buddha says that knowledge arose at his awakening.
The Islamic perspective
The Prophet (ﷺ) is a man to whom revelation came. He knows of the unseen only what God (﷾) reveals to him.
The Qur'an has the Prophet (ﷺ) say that he is a man, and that he does not know the unseen.
God (﷾) reveals what He wills of the unseen to a messenger He has chosen.