Section 24. Whoever conducts a lodging house without a license shall be punished by a fine of not less than one hundred nor more than five hundred dollars or by imprisonment for not more than three months, or both. Upon the complaint of an aggrieved party, the licensing authority or an officer of a city or town wherein such unlicensed lodging house is conducted, a justice of the housing court division or the superior court division of the trial court, may enjoin the conducting of any unlicensed lodging house and may make such other orders as the court may deem equitable to enforce the provisions of sections twenty-two to thirty-one, inclusive.