Praise be to Allah.
The Prophet (peace and blessings of Allah be upon him) forbade making death announcements; what is meant by this prohibition is what the people of the Jaahiliyyah used to do, when they used to send someone to announce a death in a loud voice. Hence the majority of scholars are of the view that if making an announcement involves raising the voice, it is not allowed.
Some of the Hanafis are of the view that it is not makrooh to call out news of a death in the alleys and markets, if it is a simple announcement which does not speak of the person’s good characteristics.
They said: Because that will increase the number of people who offer the funeral prayer for the deceased and pray for forgiveness for him. It is not like the death announcements of the Jaahiliyyah, for they used to send people to the tribes, announcing the death with screaming, weeping, wailing, elegizing, etc. My response to that is that the aim of increasing the number of people who offer the funeral prayer for the deceased and pray for forgiveness for him can be achieved without calling out and raising the voice.
Moreover, raising the voice with news of a death is like the Jaahili way of making death announcements, which is forbidden.
See al-‘Inaayah Sharh al-Hidaayah, 3/267; Fath al-Qadeer, 2/128; al-Khurashi ‘ala Mukhtasar Khaleel, 2/139; al-Muhadhdhab, 1/132; al-Sharh al-Kabeer, 6/287; Fath al-Baari, 3/117
Al-San’aani said in Subul al-Salaam (1/482):
In al-Nihaayah it says that it was well known among the Arabs that when a nobleman among them died or was killed, they would send a rider to the tribes to announce his death to them, and he would say, “I announce the death of So and so, I announce the death of the Arabs; or So and so has died, the Arabs are doomed because of the death of So and so.”
Then al-San’aani said: It seems more likely to me that this is what is forbidden, and that includes announcing deaths from the top of the minarets as is done nowadays when leaders die. End quote.
Shaykh al-Albaani (may Allah have mercy on him) said, explaining what is forbidden for the relatives of the deceased:
Announcing the death from the tops of the minarets and the like, because that is a kind of death announcement (al-na’i), and it is proven from Hudhayfah ibn al-Yamaan that when one of his relatives died he would say, “Do not tell anyone, for I fear that this would be a death announcement, and I heard the Messenger of Allah (peace and blessings of Allah be upon him) forbidding death announcements.”
In Arabic, the word al-na’i (translated here as death announcement) means informing others of the death of a person. This includes all forms of giving this information. But the saheeh ahaadeeth indicate that some kinds of informing others of a death are permissible, and the scholars gave a specific definition to the general term al-na’i. They said: what is meant by al-na’i is announcements that are similar to what the people of the Jaahiliyyah used to do, where they would shout at the doors of houses and in the marketplace.
Al-Haafiz said: What we learn from this is that not all kinds of death announcements are forbidden, rather what is forbidden is what the people of the Jaahiliyyah used to do; they used to send out people to announce the death of a person at the doors of houses and in the markets.
I (al-Albaani) say: Once this is understood, shouting news of a death from the tops of minarets is certainly a form of al-na’i, hence we are certain that it is haram. It may be accompanied by other things that are haram in and of themselves, such as accepting payment for that shouting, or praising the deceased person by saying things that are known to be untrue, such as saying, “Pray for one who was most noble and generous, or Pray for one who followed in the footsteps of the righteous salaf.”
Ahkaam al-Janaa’iz, p. 44-46.
This is the answer if what is meant in the question is making death announcements from the minaret over loudspeakers.
If what is meant is simply informing the worshippers in the mosque of the death without raising the voice, there is nothing wrong with that in sha Allah. This is like what the Prophet (peace and blessings of Allah be upon him) did after the death of the Negus, when he informed the Sahaabah of his death and announced it to them so that they could offer the funeral prayer for him.
Al-Bukhari (1333) and Muslim (951) narrated from Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings of Allah be upon him) announced the death of al-Najaashi (the Negus, the ruler of Abyssinia) on the day on which he died. He took them out to the prayer place, arranged them in rows and said four takbeers (i.e., offered the funeral prayer for him). According to a report narrated by al-Bukhari, 1328: The Messenger of Allah (peace and blessings of Allah be upon him) announced to us the death of the Negus, the ruler of Abyssinia, on the day on which he died, and said, “Pray for forgiveness for your brother.”
Al-Nawawi said in Sharh Muslim:
This shows that it is mustahabb to announce the death of a person, but not in the manner in which deaths were announced in the Jaahiliyyah; rather it should be done simply for the purpose of notifying people so that they can come to the prayer, and to encourage people to attend his funeral and to fulfil their duty towards him in that regard. The prohibition on death announcements does not apply to this, rather it applies to the jaahili forms of death announcements which includes mention of the good qualities of the deceased and so on. End quote.
See also question no. 60008
And Allah knows best.