When, in an action by or against a county or municipality, if in the opinion of the court the interests of the county or municipality would be promoted thereby, the court may, upon terms, allow a taxpayer and resident of the county or municipality to intervene in the action on behalf of and prosecute or defend the same in the name of the county or municipality.
N.J.S. § 2A:15-19