To the best of my knowledge a lender does not HAVE to report the deficency as income (1099). If reported it is not reported as capital gains. There is a IRS form that (supposedly) negates the 1099 due to hardship, but I do not know if it works. Best to prepare for the worst case scenario.
I have been told that the difference would be taxed as income, but who knows with so many IRS loopholes. If there are any CPAs on this forum, or anyone else who knows the answer, maybe you could post your answer so we all know ONCE AND FOR ALL.