Get your taxes done using TurboTax

the best I can figure out is the worksheet on page 88 of the attached.  That is the IRS's official determination of figuring out what is taxable

 

https://www.irs.gov/pub/irs-pdf/i1040gi.pdf

 

also, please read through the exceptions in the middle of page 86 and see if any apply.  If yes, the go to Publication 525. 

I suspect at a minimum, the net amount ($2000 is taxable which I think you readily agree with) but I would not be surprised if it works out that the entire $5000 is taxable.  One could make the case you are getting the benefit - it's just rolled into the standard deduction.