One of the elements in legal malpractice is privity. That term means, a contractual relationship. Cllients often want to sue their opponent’s attorney, usually for the things they did for the opponent. For the most part, one may sue only his attorney, the is, the attorney who was retained.
One exception comes up with opinion letters or due dilligence reports. If a third party relies upon such letters or reports, even by an attorney whom they did not hire, and does so to a detriment, then there may be a close enough relationship for a legal malpractice case.