When the occupier of a building or land has, in compliance with a notice issued under this Act, executed a work for which the owner of such building or land is responsible either in pursuance of the contract of tenancy or by law, he shall, in the absence of any contract to the contrary, be entitled to recover from the owners by deduction from th...