You would use Form 4797 only when the property was a rental property for which depreciation had been taken (or should have been taken). That was not the case here. It was an investment property and thus goes on Schedule D.

You get the step up in basis and it qualifies for long-term treatment.