וְשָׁפַכְתִּי֩ עַל־בֵּ֨ית דָּוִ֜יד וְעַ֣ל ׀ יוֹשֵׁ֣ב יְרוּשָׁלִַ֗ם ר֤וּחַ חֵן֙ וְתַ֣חֲנוּנִ֔ים וְהִבִּ֥יטוּ אֵלַ֖י אֵ֣ת אֲשֶׁר־דָּקָ֑רוּ וְסָפְד֣וּ עָלָ֗יו כְּמִסְפֵּד֙ עַל־הַיָּחִ֔יד וְהָמֵ֥ר עָלָ֖יו כְּהָמֵ֥ר עַֽל־הַבְּכֽוֹר׃
און איך װעל אױסגיסן אױף דעם הױז פֿֿון דוד, און אױף די באַװוינער פֿֿון ירושָלַיִם, אַ גײַסט פֿֿון לײַטזעליקײט און געבעט, און זײ װעלן קוקן צו מיר װעגן איטלעכן װאָס זײ האָבן דערשטאָכן, און װעלן קלאָגן אױף אים װי מע קלאָגט אױף אַן אײנאײנציקן, און זיך ביטערן נאָך אים װי מע ביטערט זיך נאָך אַ בכָור.
Rashi
a spirit of grace and supplications That it should come into their mind to supplicate Me, and they will be in My good graces.
Abarbanel
Similarly, it says, "And I will pour out on the house of David and on the inhabitants of Jerusalem a spirit of grace and supplications," and it was said of the children of Judah that they are all called the house of David, and of the other tribes that are included among the inhabitants of Jerusalem, it says "the inhabitants of Jerusalem." It is mentioned that the death of that righteous person will be precious in the eyes of the Lord, and because of this, the Lord will seek ways to destroy all the nations, meaning that when the Messiah, son of Joseph, dies in battle, the Lord’s anger and jealousy against those nations will be kindled. Therefore, He will cause events to strengthen their war efforts in order to destroy and annihilate them. As a result, most of them will be destroyed, and the third will remain, and the majority of them will be wiped out. This will be aided by the Lord pouring out a spirit of grace and supplications on them, meaning He will put it into their hearts to pray and plead before Him for the death of that righteous one, and they will lift their eyes to heaven and look to Him, blessed be He, for that perfect one whom the enemies will pierce. They will say before Him, "The spirit of our face, anointed one of the Lord, has been captured in the wickedness of the enemies, whom we said, 'In their shadow, we will live among the nations,'" and they will mourn for him as one mourns for an only son, as a father mourns for his son.
Ibn Ezra
"And I will pour out" — I will pour out a spirit of grace and supplication upon the inhabitants of Jerusalem. Before this, trouble will come upon them, because Messiah ben Joseph will be killed. Then God will become angry and destroy all the nations that come against Jerusalem, and this is the meaning of 'And they will look to Me' — then all the nations will look to Me to see what I will do to those who pierced Messiah ben Joseph.
Rashi
they shall look to Me because of those who have been thrust through Jonathan renders: And they shall supplicate Me because of their wanderings.
Rashi
And they shall look to Me. to complain about those of them whom the nations thrust through and slew during their exile.
Rashi
as one mourns over an only son As a man mourns over his only son. And our Sages expounded this in tractate Sukkah (52a) as referring to the Messiah, son of Joseph, who was slain.