If an action is brought to enforce a mechanic's lien against real property in a court of record, the costs and disbursements shall rest in the discretion of the court, and may be awarded to the prevailing party. The judgment rendered in such an action shall include the amount of such costs and specify to whom and by whom the costs are to be paid. If such action is brought in a court not of record, they shall be the same as allowed in civil actions in such court. The expenses incurred in serving the summons by publication may be added to the amount of costs now allowed in such court.
N.Y. Lien Law § 53