The presence and mass of nearby massive halos predict galaxy quenching