Be careful with the use of dielectric grease. It is after all a very good isolator. be careful not to get it on the terminal pins and in the female connectors. If you do use it, put it on and then wipe it off, there will be enough left to prevent corrosion, but not impair conductivity. Oh Yes, it will prevent corrosion but it will also impair the flow of electricity between the two as the grease will isolate them. Use it on the threaded part to prevent the entrance of moisture.
One of the most frequent reasons for corrosion on those terminals is not disconnecting them when not in use. Simply turning the unit off does not disconnect the head unit from your boats 12 volt electrical system. As long as you can turn on the unit by pressing the on button, you have power to the unit. To prevent this either disconnect the power cable to the unit at the rear of the head or install an on/off switch in the power cable (12volt feed) to the unit and turn it to off when not using the boat.
The blue female plug (sonar) is very corroded, if you are unable to clean it satisfactorily it may need to be replaced.
If you are very careful you can also wedge open the male connectors a little bit (making more of a friction fit with the female section) by using a thin strip of metal, a clean feeler guage works well. Be forewarned however that if the pin is corroded it may snap off.
Edited for clarity (I hope)