Judgment in case of failure to establish lien

N.Y. Lien Law § 54, under Enforcement of Liens On Real Property.

N.Y. Lien Law § 54

§ 54. Judgment in case of failure to establish lien. If the lienor shall fail, for any reason, to establish a valid lien in an action under the provisions of this article, he may recover judgment therein for such sums as are due him, or which he might recover in an action on a contract, against any party to the action.