In Matthew 26:39 Jesus said:
Πάτερ μου, εἰ δυνατόν ἐστιν, παρελθάτω ἀπ’ ἐμοῦ τὸ ποτήριον τοῦτο πλὴν οὐχ ὡς ἐγὼ θέλω ἀλλ’ ὡς σύ.
The King James translation gives this as:
O my Father, if it be possible, let this cup pass from me: nevertheless not as I will, but as thou wilt.
Because the cup is mentioned by Jesus, the expression is familiar, but where does the cup come from? Cups do figure into the Passover ceremony but not in such a way that it makes sense in the way that Jesus uses it.
The same term, cup (ποτήριον), shows up in Psalm 74:9 (Psalm 75:8 in the KJV):
ὅτι ποτήριον ἐν χειρὶ κυρίου οἴνου ἀκράτου πλῆρες κεράσματος καὶ ἔκλινεν ἐκ τούτου εἰς τοῦτο πλὴν ὁ τρυγίας αὐτοῦ οὐκ ἐξεκενώθη πίονται πάντες οἱ ἁμαρτωλοὶ τῆς γῆς
For a cup of undiluted wine is in the Lord's hand, full of mixture and he tips it from this to this but its dregs will not be poured out, all the sinners of the earth shall drink them.
So the reference to drinking the cup seems to refer back to the cup that the Psalmist sang about, the cup of the wrath of God directed at sinners.