The reaction that causes copper to turn black quite quickly is the presence of high levels of sulphur and moisture. This produces copper sulphide which is black in colour. A by product of the reaction is the gas hydrogen sulphide, the very smelly gas that is the same as the gad given off by rotten eggs. Hydrogen sulphide gas is highly poisonous - but generally when you can smell it, it is in very low concentrations.
There are probably two issues here, a small leak , delivering moisture and a source of sulphur ( probably from a cleaning product). If you have an ion exchange water softener - the waste water from regeneration, if leaking, will exacerbate this problem. As will the waste water from a dishwater that uses salt to artificially soften the wash water.
If you want to test for the presence of sulphur in the atmosphere place a piece of polished silver in the area - place it in a dry spot. If sulphur or sulphur dioxide is present it will quickly ( 2 to 3 days) tarnish very badly.
The other pollutant that may be playing a part is ammonia ( again a product often found in glass cleaning - window gleam type products).
Another, less likely, cause of high sulphur levels is a leaking sewer
If you open the electrical socket, I think that you will see the same problem ( blackened copper) on any exposed copper wires there too.
The solution is to remove all chemical products, identify and isolate the source of moisture and then thoroughly clean the pipes with wire wool.
It is very important that all traces of the blacken copper pipe deposits are removed. For the areas impacted by mould wash down with hydrogen peroxide. Beware that this is a strong bleach - I will say no more!
Often the solution is to remove all the blackened pipe and associated fittings and replace with plastic coated pipe.
Apologies for being depressingly blunt, but rather like damp and mould, to resolve the issue you have to remove both the cause and the products already created.
Having said that, don’t ignore or leave it, beyond the smell, which signifies an active reaction, the copper will erode quite quickly, particularly if there is an electrical potential between the copper pipe and earth.
Make sure that your property does not have an equipotential damp proof membrane installed - this can sometimes be the cause. If you have such a system it will be connected to the mains electricity supply
The products causing this reaction with react with other items in the household - silver being one. From the leak (or possibly damp) perspective once mould spores develop they are very difficult to eradicate.
Apologies for the depressive nature of my note - but you did ask!