There has to be somebody touching your pirate(enemy, companion, pet, summon, whatever). As soon as you get to half health, it should trigger if you are touching something living.
Being next to some creature is necessary, but be aware that the earring will drain the closest, most wounded being near you ( and yes, that includes your crew ). If you're being hit by ranged attacks and your team isn't near you, then it won't work. If these aren't the conditions you're experiencing then it is a glitch to be reported.