The court, upon or after granting a divorce from the bonds of matrimony to either spouse or dissolution of a civil union to either partner in a civil union couple, may allow either spouse or partner in a civil union couple to resume any name used by the spouse or partner in a civil union couple before the marriage or civil union, or to assume any surname.
N.J.S. § 2A:34-21