we had a similar problem when the front flat in my building was renovated. The builders removed all the gas heating and fitted electric (at the request of the owner who rented it out) and as they had no pressure for the shower (fed from an immersion heated tank) they fitted a pump which fires up every time they use a hot tap or the shower. Why the fudge they didn’t just fit an instant water heater and an electric shower I don’t know.
I’ve just ripped out my tank and heating so have added some extra insulation to the back of my (old tank) airing cupboard which theirs backs onto with the pump inside. Won’t stop the noise as you can also hear it from the pipes but will help.
Noise drives me mad. I could hear the compressor in the upstairs flat kitchen when in bed and in this house (out in the country not the flat in the city) I can hear the boiler of the bungalow next door but one when we have the sash window open and the secondary glazing closed.
I have quite sensitive hearing and tend to lock onto repetitive noises.