An Israeli strike in northern Gaza killed a family of four, including two children, with the military saying it was targeting a militant.