An engine contained within a bare aluminum cowling should be painted white not black to reflect the radiant energy back to the cowling. Another technique would be to paint the inside of the cowling black to eliminate reflection of heat energy. If the aircraft had a plastic cowling then the engine need not be painted white because of the low reflectance of plastic. Most heat from the engine is transferred to the atmosphere by convection rather than by radiation. Radiant cooling of an engine is negligible.
Engines run quite nicely no matter what color they're painted.
Although engines get all the attention, the engine compartment can be engineered to better manage temperature. The engine compartment is one of the most heat damaging environments there is. Packed in the same compartment are glowing exhaust components, rubber products, electronics, wiring, pumps and magnetos. Little effort has been made at controlling heat exchange by changing the infrared emissivity and reflectivity of components. Small changes, such as the addition of reflective heat shields, can be very effective.