x2 for CD's suggestion, but if the toothbrush doesn't work sufficiently, then you could also maybe try using a small piece of 1000 grit wet&dry paper folded -lengthwise- over the end of a wooden paddle-pop stick and then --gently-- use it to polish off the corrosion visible on the pins in your photo. I wouldn't get --too-- eager with it ie, just slide the wet&dry back and forth gently, lengthwise along each of the pins, until the worst of the crap is removed. The opposite side other half of that connector ie, with the 5 little matching mating "sockets" in it is a bit more problematic because you can't get easy access into each of them to clean them. Best thing I could suggest is to give it a scrub with the toothbrush as CD suggests and perhaps also maybe use a toothpick to prise out any "obvious" bits of corrosion that you can see in there.
Once you've done all that then wash it / flush it well, with something like wd-40 or RP7 and then shake that all out (or preferably, blow it out with compressed air) so that there are no tiny "metal" dust / filings left inside of the connector housing from the "polishing" process.
When you're happy with the look of the cleanliness of the pins then I would spend just a couple of bucks at Soupycheep on buying a spray can of "LanoTec-GP" and give all the pins and sockets and all of the insides of the connector halves a good solid squirt of it.
The good thing about LanoTec-GP is that it not only cleans electrical connections but it also provides a fairly long-lived waterproofing of them as well, doing a far better job of that, than just WD-40 or RP7.
Finally, before re-assembling the connector have a close look at it to see if there is any obvious physical damage or trapped dirt that might compromise the effectiveness of the little "seal" located at the back edge (ie, closest to the wires) of the other half of the connector ie, the half with the 5 little sockets inside of it.....