Thank you my dear friend for your very excellent question! Psalms 87 describes the glory of Zion, which is established as the city of our God. The verse you have cited says, “I will make mention of Rahab and Babylon to those who know Me; Behold, O Philistia and Tyre, with Ethiopia: ‘This one was born there.'” (NKJV).

In verses 5-6 we read, “And of Zion it will be said, “This one and that one were born in her; And the Most High Himself shall establish her.” The LORD will record, when He registers the peoples: “This one was born there.” Selah.”

Thus, you will readily see that name of Rahab not only refers to the harlot of Jericho, but also it is used to indicate Egypt in several Old Testament verses, including the one which you have mentioned. I will quote the Morrish Bible Dictionary on the name Rahab.  That says, “A poetical name, signifying ‘insolence,’ given to Egypt. Psalm 87:4; Psalm 89:10; Isaiah 51:9. The same word occurs in Isaiah 30:7, where the R.V. reads “therefore have I called her Rahab that sitteth still.” I pray this response was helpful!  (SF)  (734.6)