Almost every culture has the Flood story; and almost always with the same basic details: a man, his wife, and three sons and daughters (or sons and their wives) are spared.
That suggests a common origin; a common inherited history.
The inspiration for the flood narrative in Genesis was the flood itself. The flood itself obviously preceded every flood narrative. Plus biblical scripture is the inspired inerrant word of god, so there’s that... Why are people so determined to prove that Moses plagiarized some earlier written account of the flood? If details differ from the Genesis account, those details represent error, simple as that.