If on a complaint made by the owner of any premises, it appears to a magistrates’ court that the occupier of the premises prevents the owner from executing any work which he is by this Act required to execute, the court may order the occupier to permit the execution of the work.