A lawyer can represent a divorcing husband even though she helped to draft his wife’s last will and testament at her previous firm, a Brooklyn appellate court found Wednesday.

The Appellate Division, Second Department, determined the past legal work of Dorothy Courten of Hauppauge was “not substantially related” to her representation of husband Joseph Sessa in the matrimonial proceedings.

Wednesday’s ruling unanimously reversed Suffolk County Supreme Court Justice John Leo’s February 2013 grant of wife Geraldine Parrotta’s disqualification motion.

After drawing up a will for Sessa, Courten’s former firm, Courten & Villar, prepared a will for Parrotta in 2009. Sessa commenced divorce proceedings in 2012, and Parrotta argued his lawyers had access to confidential information through its will drafting.

The panel’s unsigned ruling said the issues in the divorce and will preparation did not have a sufficient connection, “particularly given that under the parties’ prenuptial agreement, the validity of which is not at issue, they waived their rights of equitable distribution.”

The panel said Parrotta offered only “conclusory allegations” that Courten & Villar had access to pertinent confidential information about her.

Parrotta’s claims, the panel continued, were “insufficient to determine the nature of the confidential information allegedly obtained or that there is a reasonable probability that such information would be disclosed.”

Justices Peter Skelos, John Leventhal, Cheryl Chambers and Joseph Maltese decided Sessa v. Parrotta, 2013-03231.

Courten & Villar recently separated into two entities and Dorothy Courten of the Law Office of Dorothy A. Courten represented Sessa. Michael Catalanotto of Nesconset represented Parrotta.