But how did Gilgamesh know that Archer has projections of the noble phantasms in the first place? Or has he met him before?
He hasn't. It's an ability inside of Gate of Babylon. He can tell due to the Origin of Intelligence in the GoB that Archer uses Projection Magecraft for weaponry. He notices that Saber has been ''tainted'' in Fate route, too, due to it. GoB isn't a vault that stores the original concept of every treasure in the world, it is
a collection of human wisdom and intelligence. The only treasures he does not possess are the ones that are out of the realm of human reasoning or intelligence or have been created by a non-humane species who's technology and intelligence is above humkan's. That's also why Gilgamesh is pretty informed of how things work regarding the World and Magi's line of work or what his enemy uses.
Projection is inside the realm of humane intelligence, of course. GoB being a collection of human intelligence is exactly why Gilgamesh possesses other things outside of only weaponry such as ships, wine, actual nukes, etc. In Fate/Extra CCC, he even stores
.
When Gilgamesh says everything created by mankind is his. He means it quite literally. Everything created by mankind; technology, treasures, information, etc. can be found in GoB. Information on Magecraft and what his enemy uses included, which is why he instantly knows Archer uses Projection Magecraft.