The counseling must qualify as a medical expense. The IRS defines a medical expense as " the costs of diagnosis, cure, mitigation, treatment, or prevention of disease, and the costs for treatments affecting any part or function of the body." This includes treatment by a licensed psychiatrist or psychologist for medical care. I cannot say whether the counseling you received meets this test. The fact that a judge ordered you to receive counseling is not relevant. The test is whether the counseling was treatment for a medical condition.