GS-15 = O-6 (Colonel/Navy Captain)
GS-14 = O-5 (Lt Colonel/Commander)
GS-13 = O-4 (Major)
GS-12 = O-3 (Captain, this is the journeyman level for engineesr)
GS-9/11 = O-1/2 (Lt's, apprentice stage)
GS doesn't start at 9, though. The lower grades are typically limited scope, no supervisory responsibility, office jobs (secretaries, mail room, clerk, data entry, etc.). Or they're training positions, straight out of college an engineer may be a GS-5/7 and after 2-4 years a GS-11/12. They don't really have a clean comparison to military ranks, that I know of.
They do, but you have to start going into the enlisted ranks for best comparisons. GS-7 might be E-6/E-7, GS-5 would be E-4/E-5, etc.
If you look at responsibility, it seems to fit.
Likewise just as D.C. has peculiar effects on the military rank of typical workers, so does it have peculiar effects on the civilian grade of workers, due to the position classification principle of "scope of effect".
But the Navy normally uses O5 to command ships of similar crew size. Very rarely, even O4... it all depends on what exactly the ship is, and what the expected mission set of that ship is.
Obviously the Navy wouldn't slot a random O4 into minesweeper command even though it's a small ship, so you're really talking about a "better than average" O4 even for those, it just reflects back to how scope of responsibility can change things even for the Navy.