Two things I’d do:
I’d go talk to the owner. Let them know that if they have a valid case it is in YOUR best interest to help them get the sale overturned so that you can get your money back. Get them to realize you are just an innocent 3rd party caught in the middle. With this I can usually get them to show me what they believe to be their case. If I think they have a strong case I get on the phone with the trustee and lender and start demanding the sale be overturned - I’ve had success with this as they tend to listen when one of their co-defendants is saying they’ll lose. If, on the other hand the owner has no case I let them know I won’t be able to help because I think the lender - as evil as they may be - are legally right, and that I think they’ll lose. If you do this HONESTLY, you may find it helps turn the tide as they then realize they are throwing good money after bad in fighting a hopeless battle. If they are filing pro se (self representing), I’ll even offer to pay for a couple hour consultation with an attorney of their choice, so long as the attorney is reputable. If the attorney is honest about the process the owner will realize just how difficult fighting a lender is, and again, reach the conclusion they should move on.
Hire a good attorney - one who’s dealt with these things and won. Ask around down at the steps, someone should have a referral. Know that the bank has more to lose here than you do, so they will likely take the lead on fighting the claims, but they aren’t going to defend you and you will need to have your attorney answer the complaint. The defenses are pretty simple. You weren’t a party to the loan fraud if any, and you are a bonafide purchaser for value. If you are comfortable waiting it out you might just leave it at that and let the lender do the heavy lifting. If you are anxious about time, try to get yourself removed from the case. If it is a case of fraud by the lender then the homeowner will still have their claim against the lender, and since you are a bonafide purchaser the sale shouldn’t be overturned. I’ve never had to go that far, so I’m not sure, but bring the idea up with counsel.
Finally don’t stop your eviction. The owner will likely fight it, so you will need an attorney here too, but its not out of the question that you’ll win the eviction despite the lawsuit. Especially if the owner doesn’t understand the process - they may think simply filing the lis-pendens stops the eviction, but it doesn’t.