Genesis and Gilgamesh provide accounts of the same event. That there are similarities should be expected when describing the same event. Just because Gilgamesh predates Genesis doesn’t mean the Genesis account was copied from Gilgamesh.
Genesis was written by Moses, inspired by God. Obviously, Moses was not around when much of the history recorded in Genesis took place. For example, Moses wrote about Adam and Eve, and the flood, but those events occurred before Moses was born.
Thus, it is entirely possible that the Gilgamesh Epic described the same flood as that later portrayed in Genesis. When Moses wrote of the flood, it was already history to him. What is “new” in the Genesis account is what God revealed about His own hand in the matter, whereas the Gilgamesh account is that culture’s man-made suppositions based on their pagan world-view.