"[He shall] inherit from me and inherit from the family of Ya'qub (Jacob)," meaning: he shall inherit their kingship and their authority. The wife of Zakariyya (Zachariah) was from the descendants of Ya'qub. It does not mean Ya'qub the elder; rather, it refers to a Ya'qub other than him.
Muhammad said: Whoever reads "yarithuni wa yarithu" (inherits from me and inherits) in the nominative case (raf'), renders it as an attribute to the "heir" (wali). The meaning is: Grant me he who inherits from me.
And whoever reads it in the jussive mood (jazm) as "yarithni wa yarith" (let him inherit from me and let him inherit from the family), then it is treated as a response to the command (waq'an jawab al-amr).
﴿يَرِثُنِي وَيَرِثُ مِنْ آلِ يَعْقُوبَ﴾ أَيْ: يَرِثُ مُلْكَهُمْ وَسُلْطَانَهُمْ؛ كَانَتِ امْرَأَةُ زَكَرِيَّا مِنْ وَلَدِ يَعْقُوبَ لَيْسَ يَعْنِي: يَعْقُوبَ الْأَكْبَرَ؛ يَعْقُوبَ دُونَهُ.
قَالَ مُحَمَّدٌ: مَنْ قَرَأَ (يَرِثنِي وَيَرِث) بِالَّرَفْعِ جَعَلَهُ كَالْنَعْتِ لِلْوَلِيِّ؛ الْمَعْنَى: هَبْ لِي الَّذِي يَرِثُنِي.
وَمِنْ قَرَأَهَا بِالْجَزْمِ (يَرِثْنِي وَيَرِثْ مِنْ آل) فعلى جَوَاب الْأَمر.