The subject is covered, insofar as California statutes go, in Civil Code sections 1695.1 through 1695.17, under the heading of "Home Equity Sales Contracts."
Section 1695.14 does indeed provide for a two-year rescission period.....however, the grounds for rescission are quite limited (see 1695.13 for the ground - "unconscionable advantage").
Further, the entire topic of "Home Equity Sales Contracts" specifically excludes true deeds in lieu of foreclosure - see subsection 1695.1(a)(2). So, in California at least, it boils down to whether you really mean "home equity sales contract" (in which a third party, not the lender, acquires the defaulting owner's equity position) rather than "deed in lieu of foreclosure" as you say, where the lender, not a third party, accepts a deed from the borrower rather than foreclosing.
The two-year rescission period applies only to the former, not the latter, and even in the case of the former, only if the deal was unconscionable.
As to New York law, I have no idea, and so can't make comparisons.