Matthew 18:19
16 But if he does not listen, take one or two others with you, so that at the testimony of two or three witnesses every matter may be established. 17 If he refuses to listen to them, tell it to the church. If he refuses to listen to the church, treat him like a Gentile or a tax collector. 18 “I tell you the truth, whatever you bind on earth will have been bound in heaven, and whatever you release on earth will have been released in heaven. 19 Again, I tell you the truth, if two of you on earth agree about whatever you ask, my Father in heaven will do it for you. 20 For where two or three are assembled in my name, I am there among them.” 21 Then Peter came to him and said, “Lord, how many times must I forgive my brother who sins against me? As many as seven times?”
Pirkei Avot 3:2
Mishnah2 Rabbi Hanina, the vice-high priest said: pray for the welfare of the government, for were it not for the fear it inspires, every man would swallow his neighbor alive. R. Hananiah ben Teradion said: if two sit together and there are no words of Torah [spoken] between them, then this is a session of scorners, as it is said: “nor sat he in the seat of the scornful…[rather, the teaching of the Lord is his delight]” (Psalms 1:1); but if two sit together and there are words of Torah [spoken] between them, then the Shekhinah abides among them, as it is said: “then they that feared the Lord spoke one with another; and the Lord hearkened and heard, and a book of remembrance was written before Him, for them that feared the Lord and that thought upon His name” (Malachi 3:16). Now I have no [scriptural proof for the presence of the Shekhinah] except [among] two, how [do we know] that even one who sits and studies Torah the Holy One, blessed be He, fixes his reward? As it is said: “though he sit alone and [meditate] in stillness, yet he takes [a reward] unto himself” (Lamentations 3:28). 3 Rabbi Shimon said: if three have eaten at one table and have not spoken there words of Torah, [it is] as if they had eaten sacrifices [offered] to the dead, as it is said, “for all tables are full of filthy vomit, when the All-Present is absent” (Isaiah 28:8). But, if three have eaten at one table, and have spoken there words of Torah, [it is] as if they had eaten at the table of the All-Present, blessed be He, as it is said, “And He said unto me, ‘this is the table before the Lord’” (Ezekiel 41:22).
Notes and References
"... A third reason Matthew 18:15-20 generates so much interest is because of the intriguing parallels in Jewish texts. "For where two or three are gathered in my name, I am there among them" recalls a saying attributed to Rabbi Hananiah ben Teradion in the Mishnah: 'But if two sit together and words of the Torah are between them, the divine presence rests between them', Abot 3:2. Similar is the saying attributed to Rabbi Simeon ben Yohai in Abot 3.3: 'If three have eaten at one table and have spoken over it words of Torah, it is as if they had eaten from the table of God.' It is possible that the saying of Rabbi Haninah was called forth by the gospel saying as a kind of counterblast. More probably, however, it expresses what was a rabbinic commonplace - so that Matthew 18:20 is a Christian revision of a rabbinic sentiment, in which Jesus replaces the Shekinah, or divine presence ..."
Allison, Dale C. Scriptural Allusions in the New Testament: Light from the Dead Sea Scrolls (p. 24) Wipf & Stock Publishers, 2019