Depends if its the type of PIR occupancy sensor which has its own neutral, or the type which is in series with the line and relies on that to power it. The former will work; the latter not.