You can simple pick whip the position value of the null as the position value for where to sample. Or set that as a variable and use the variable. Using Dans example.
target = thisComp.layer("background");null = thisComp.layer(“yournulllayer”).transform.position;
target.sampleImage(null, [width, height]/2, true, time)