It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When a newborn child cries out, the funeral prayer is offered over him, and he also inherits."
Others are more reliable than Isma'il bin Muslim al-Makki; and it has been narrated as marfu' (from the Prophet) from Abu al-Zubayr through other routes.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6783