Does look like glue, quite common to prevent resonant vibrations usually on coils, xfrms etc..
If you want to change it for your piece of mind and cap of the same voltage rating and uF rating will suffice. You can replace with a slightly higher volt i.e if its 16v go up to 25v, the physical...