Yes it counts, in both situations you but you must hit the boss at least once before he dies.
If you remember the bug of Oberon where ppl just use to heal (with sio or UHs) someone who was killing the boss before they finish to kill it.it, after that was the tactic used in CIP made some changes to avoid it, now all you heal will be awarded with the loot. count if, and only if, you hit the boss at least once before he dies.