Although mining an ally may be tempting, keep in mind that your ally minds getting mined and may report you for friendly mining. Although it may seem like a minor offense, as a former miner myself I assure you that Muse and the community frown upon friendly fire.
Cease fire when their armor breaks or you will cause permanent damage. If they have a completely fresh ship (hasn't been shot by an enemy), quickly mine them until they die (won't count as a kill). Once you commit you can't stop until they die. You need to kill them as quick as possible before your opponents show up. Best when used in conjunction with tar and something hard.
Seriously though don't do it, it's rude. And it can seriously screw up an engagement.