Each county may authorize any municipality in the county to use, for municipal purposes, a portion of any county building and any municipality may permit the county in which it is located to use for county purposes a portion of any municipal building, not needed for the purposes of the county or the municipality, as the case may be, upon such terms as shall be agreed upon by the governing bodies of the county and the municipality.
N.J.S. § 40A:12-25