Numerous parallels exist between the Hebrew Bible and the ancient Babylonian epic of Gilgamesh; however, writes Shawna Dolansky, it is difficult to demonstrate that one influenced the other:
The Gilgamesh epic was familiar in the biblical world: copies have been found at Megiddo, Emar, Northern Anatolia, and Nineveh. It shares many motifs and ideas (such as the Flood) with other ancient Near Eastern texts. Because of this, it is difficult to state with any certainty that the epic directly influenced the stories of the Bible. For example, it was widely believed that dreams could be divinely inspired, cryptic forecasts of the future. So when Joseph dreamed of sheaves of corn and bowing stars (Gen. 37:5-11), the author was probably not copying Gilgamesh’s oracular dreams. . . .
In the epic [of Gilgamesh], the gods create Enkidu, who runs wild with the animals in the open country, as a companion for Gilgamesh. There are particularly interesting similarities between the Garden of Eden story in Genesis and the story of Enkidu’s movement from nature to culture and civilization. In both stories, a woman is responsible for the transition of a man who had once eaten and drunk with the animals to a state of estrangement from nature. Once Enkidu is rejected by the animal world, the woman Shamhat gives him clothing and teaches him to drink beer and eat bread—all technological developments that separate humans from animals.
Read more on Bible Odyseey: http://www.bibleodyssey.org/places/related-articles/gilgamesh-and-the-bible.aspx