It is good that you are getting professional help for your depression, and I hope you keep up with whatever treatment has been prescribed. Also, as the needlestick is still on your mind, and probably will be until you do something about it, my view is that you should follow your institution's set procedures for reporting the needlestick, even if you are late in doing so (better late than never), and if they offer counselling, take it.
What does your residency contract say about taking time off for illness? Can whoever is treating you for your depression sign you off as ill, and what would the effect of that be? As you are in the last year of your training, it should be easier for your program to add in the missed time at the end of your year than it would be if you were PGY1 or 2.
I think you are right to be proactive in dealing with your worries about the upcoming ICU rotation - the worst thing for you to do would be to try to get through it when you are in no state of mind to do so, and coming up short. So I would suggest: firstly, talk to your medical practitioner about whether you could be signed off work, then discuss how you feel and what to do about it with someone sympathetic in your program (chief resident? resident adviser?). You will probably need to go to your PD, but it is a good idea to go with a plan: eg my medical practitioner is proposing to sign me off work for [x days/weeks], I've spoken to [chief resident/] about re-scheduling my rotations, I've spoken to [residency adviser?] about [eg making the time up later as specified in my contract].
Best wishes.
Edit: I posted without seeing aPD's advice (a failure to refresh), and had no intention to try to trump what he said.