While your ship is sinking, stay on board, equip a musical instrument and start playing. As long as your ship is in the sinking process and some part of the ship remains above the water this should unlock without trouble.
Your ship doesn’t have to be sinking as the result of combat either, you can vote to scuttle in the options menu and get the achievement that way as well. Just make sure you’re already on board when scuttling, as the ship sinks quickly.