It is called "potting." From the looks of the scrape marks, it looks like a hard substance, rather than rubbery. It could be a low-temperature thermal setting compound but is more likely a catalyzed plastic, like epoxy but not necessarily epoxy.
In any event the chances of finding a solvent to dissolve that mass without damaging the electronics are slim. You could try dissolving a chip in acetone, methyl ethyl ketone (MEK), or chloroform/methylene dichloride.
Most likely, you will need to remove most of the solid by careful chipping and grinding. Then, clean up with a solvent or heat. Many epoxies become plastic at 130° to 145°C. Obviously, the box it is in will be a hindrance, so if it can be sacrificed, I would saw through the sides and peel it away. If you can get it an X-ray, that will help.
How valuable is it and is it worth all that work? If it contains an MCU, then getting the potting compound off will not be the end of your problem.