John was a Jew who wrote in Koine Greek.
NIV John 5:2
Now there is in Jerusalem near the Sheep Gate a pool, which in Aramaic is called Bethesda and which is surrounded by five covered colonnades.
Strong's Greek 1447: In the Hebrew, or rather, in the Aramaic dialect. Adverb from Hebrais; Hebraistically or in the Jewish language.
Luke wrote the Book of Acts. He was a Gentile.
NIV Acts 21:40
After receiving the commander's permission, Paul stood on the steps and motioned to the crowd. When they were all silent, he said to them in Aramaic
Adjective - Dative Feminine Singular
Strong's Greek 1446: The Hebrew language, or rather: Aramaic. From Eber; the Hebraistic or Jewish language.
In https://biblehub.com/acts/21-40.htm, 8 out of 29 versions translate Ἑβραΐδι as Aramaic.
Both the adverb Ἑβραϊστὶ and the adjective Ἑβραΐδι comes from the noun Ἑβραΐς.
Thayer's Greek Lexicon
STRONGS NT 1446: Ἑβραΐς
Ἑβραΐς (WH Αβραΐς, see their Introductory § 408), ἑβραιδος, ἡ, Hebrew, the Hebrew language; not that however in which the O. T. was written, but the Chaldee (not Syro-Chaldaic, as it is commonly but incorrectly called; cf. A. Th. Hoffmann, Grammat. Syriac., p. 14), which at the time of Jesus and the apostles had long superseded it in Palestine
So both verses refer to the local vernacular language, often labeled as Aramaic by modern people.