just on the face of it, you have a gain from the 2 numbers provided. The mortgage owed has nothing to do with the capital gain.
There are more factors at play here.