Constructing the correlation function of four stress-tensor multiplets and the four-particle amplitude in N=4 SYM