§ 1521. Judgment. 1. Final judgment in the action shall declare the validity of any claim to any estate or interest established by any party to the action. The judgment shall also declare that any party whose claim to an estate or interest in the property has been adjudged invalid, and every person claiming under him, by title accruing after the filing of the judgment-roll, or of the notice of the pendency of the action, as prescribed by law, be forever barred from asserting such claim to an estate or interest the invalidity of which is established in the action, and may direct that any instrument purporting to create any such estate or interest be delivered up or cancelled of record or be reformed of record as the facts may require. Judgment may also be given awarding possession of real property to any party together with his damages for the withholding of such property and two or more of such forms of judgment may be awarded in the same action.
2. If one of the parties to the action is the people of the state and the judgment adversely affects the title, interest or claim of the people of the state based upon a tax deed, the judgment shall also provide in effect as follows:
a. That the people of the state of New York shall have a lien upon such real property or part thereof described in such tax deed, prior and superior to all other liens, (1) for the amount of the unpaid taxes not adjudged illegal in such action for which such real property was sold or liable to be sold in the first instance and for which such tax deed was issued, together with fees, charges and interest; (2) for the amount of the unpaid taxes not adjudged illegal in such action for which such real property was subsequently sold or liable to be sold, together with fees, charges and interest; (3) for the amount of all taxes, fees and charges admitted or paid by the people upon such real property to the date of the entry of such judgment, together with interest thereon from the date of such admission or payment. In the determination of the amount of such lien, establishment of payments of taxes on said land by the adjudged or admitted owner of the property during any of the same years in which payments were also made by the people of the state of New York shall reduce the lien of the people by the larger of the two tax payments for each of the years affected by duplicate payments, and in the event that wholly identical areas are not affected by the duplicate payments the court shall have power to apportion and adjust the amount of the lien as equity may require;
b. That the people of the state of New York may foreclose such lien as a mortgage on real property is foreclosed, provided such lien remains unpaid after the expiration of one year from the entry of such judgment.
The remedy provided by this subdivision for recovery of tax payments shall be in addition to any other remedy now or hereafter available in law or in equity.
3. If a judgment described in subdivision 1 or subdivision 2 is taken upon the defendant's default in appearing or pleading, it shall not award costs to either party, unless it be taken upon a default in answering after the decision of a motion addressed to the complaint. A defendant against whom no personal claim is made in the complaint shall not be entitled to costs unless awarded by the court when such defendant asserts in his answer and establishes a claim in said lands adverse to the claim of the plaintiff in said action.
4. Where a verdict, report, or decision is rendered, as prescribed by subdivision 4 of section 1519, final judgment to that effect must be rendered accordingly, without damages. In such a case, an execution for the delivery of the possession of the property may be issued upon the judgment; but only by the special order of the court, made upon an application by the defendant, or a person claiming under him, and upon satisfactory proof that the time has arrived when, or the contingency has happened upon which, the applicant is entitled to possession by the terms of the judgment.
5. Where the judgment directs that an instrument be delivered up, cancelled or reformed of record, or that real property be conveyed, if the direction is disobeyed, the court, by order, besides punishing the disobedience as a contempt, may require the sheriff to take, and deposit or deliver, the instrument or to convey the real property, or to perform the required acts in conformity with the direction of the court.