CAs pay the CRAs for report updates on people who have mortgage application inquiries. That's probably what happened in your situation.
When someone is applying for a mortgage, the CA knows the homebuyer can't close on the loan with the outstanding collection account on their report. So the CAs monitor reports and wait to strike when the homebuyer is desperate.
First: Do you owe the money? Your post doesn't indicate if you think the debt is real. If it's real, why didn't you pay it? Are there other "surprises" that could come up in the next couple of months? If so, you need to be ready for them, as there is a good chance other CAs could do the same thing.
Second: If you do owe the money, get something IN WRITING from the CA before you pay, indicating that the debt will be fully resolved if you pay, and that the debt will be removed from your reports. They can and will do this if you push for it.
Third: Don't be afraid to ask for a 50% discount if you pay immediately. Just be sure to get it in writing that the debt will be settled in full.
Fourth: Don't talk about the mortgage with the CA. In the unlikely event they don't know about your mortgage app, you don't want to tip them off. They will be a lot less likely to give you a discount if they know you are desperate.