The $25K allowance is the special allowance for rental real estate with active participation and also has income limitations depending on the filing status. The OP didn't give us enough information to determine that. Prior and current year PALs of a particular passive activity are allowed in full in the year of complete disposition, but if the taxpayer has other rentals with losses, those would not be allowed.
The gain on sale is not passive income. It is considered portfolio income, and the loss on the activity isn't allowed because of the gain, but because it was completely disposed of. The property could have been disposed of at a loss, and the PAL's and current year loss would still have been allowed because of its complete disposition.
See my statement above. The gain on sale is not passive income. You might find that reviewing the definitions of portfolio, investment, and passive income to be helpful, as well as the instructions for Form 8582. Those instructions are quite extensive and give a lot of information that you may find userful.