That's funny. The OED says it's found in all modern Germanic languages, but it's not recorded before about 1500. I always find it fascinating when a modern word has an obscure origin.
I was doing some thinking, the Bible's use of "flag" is even more baffling. It appears to mean some sort of water plant.
"And the woman conceived, and bare a son: and when she saw him that he was a goodly child, she hid him three months.
And when she could not longer hide him, she took for him an ark of bulrushes, and daubed it with slime and with pitch, and put the child therein; and she laid it in the
flags by the river’s brink."
I wonder if since flag doesn't mean what it means now, and isn't used in the Bible that way, is why in the Book of Mormon Captain Moroni's banner isn't called a flag, it's called a "Title of Liberty".