All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
This issue is related to the scholarly difference of opinion as to whether the intellect (mind/reason) is in the heart or the brain. The preponderant view is that the intellect is in the heart; Allah, The Exalted, says (what means): {So, have they not traveled through the earth and have hearts by which to reason and ears by which to hear? For indeed, it is not eyes that are blinded, but blinded are the hearts which are within the breasts.} [Quran 22:46] The phrases "hearts by which to reason" and "blinded are the hearts which are within the breasts" indicate that the heart is the center of intelligence, not the brain.
It is said that the brain is the deputy of the heart, and the intellect is connected to it, as underlined by Al-‘Ayni in his commentary on the ahaadeeth in Saheeh Al-Bukhari, as he wrote, "The statement 'my heart preserved it' indicates that the intellect is in the heart, not the brain. This is the view held by the majority of the scholars. If the intellect was in the brain, he would have said, 'my head preserved it.' There is a third opinion in this regard which says that both of them (heart and brain) share the intellect." ['Umdat Al-Qaari Sharh Saheeh Al-Bukhari, 2/144]
The Fatwa of the Permanent Committee for Islamic Research and Fataawa reads:
"The source of reason and intelligence is the heart, and it has a connection with the brain, as has been underlined by the researching scholars. In fact, the authentic texts do not contradict sound reason; if there is a seeming contradiction, then one of them is defective (i.e. either the reason is wrong or the religious texts are inauthentic). In addition, all the information underlined in the religious texts conform to reason; so it is an obligation to give precedence to religious texts over reason because the authentic texts are infallible, whereas reason is deficient and not infallible."
For more benefit, please refer to fatwa 28023.
Allah knows best.