I'm glad you brought up Gilgamesh, however, because there is a tremendous amount of literary evidence that parts of the Bible were modeled after passages of Gilgamesh.
I had a student once in a World Literature class I was teaching who compared Gilgamesh to the Biblical stories of Saul and Samuel.
The comparisons are striking, especially as to the characters.