imho, the easiest way is to prepare an array to multiply original one with, based on the arithmetical signs of your reshaped D array. And then mutiply it with your flipped original T array.
m = np.where(np.sign(D)[:, None]>0, [-1, 1], [1, -1])
res = np.flip(T,1)*m
res:
[[ 2 -1]
[-4 3]
[-6 5]
[ 8 -7]]