Genesis doesn’t state when it was written but Epic of Gilgamesh is around 1200 b.c.e. but they say that Gilgamesh was probably a real ruler in the late Early Dynastic II period (ca. 27th century BC). Two diminant dates for the Genesis is about 5500 b.c. and 4000 b.c.
Main connection between stories is Flood myth. It’s a theme widespread among different cultures. This story is mentioned in biblical, Quaranic accounts, in greek mythology and in Epic of Gilgamesh. The details, motive, outcomes are mostly the same in both sotries. Difference is that Utnapishtim was made to be a God but Noah in Genesis staied a human and was tald to “go out of the ark, you and your wife and your sons and your sons’ wives, with you. All the animals that are with you of all flesh, fowl and cattle and every crawling thing that crawls on the earth, take out with you, and let them swarm throught the earth and be fruitful and multiply on the earth”(pp 36). Timewise thereis a differense too as in Epic of Gilgamesh the flood was for 7 days and in Genesis for 10 month and 7 days. There is a mysterious thing for 7 in both cultures.
Its hard to say what story came first but some scholars say that early Jews were not a people who wrote things, so the Genesis story could have been around orally for some time before it was written.
A lot of discussions and arguments are going on this issue but still supporters say that finding the Ark would validate their views on a whole range of matters.
Genensis is seen as more scientific book but the Epic of Gilgamesh contains a lot from myth. This explains its divine-human interactions, mortality issue, divine inteference in humans’ lives.