Only cure is a REAL cleaning
There is nothing...at least nothing that's safe to use...that will stop the growth--actually, growth, death and decay--of the molds, fungi, sea water organisms and bacteria that thrive the dark stagnant pond that is a wet bilge. The only way to get rid of them is wash them out with plenty of detergent and water, followed by a thorough rinse to get rid of all the dirty water. About once a year is all it usually takes. Read the articles "Boat Odor Is Not All In Your Head" and "Head Related Odors--Cause and Cure" (why there's anything in that one about bilge cleaning is hard to explain...I really need to do some editing) for more detail.