Ah I think I misread what you wrote. If you want to do the backward with grad_output as a linear combination of these outputs you can do this:
out1 = net1(input)
out2 = net2(out1)
other_out = net3(out1)
out1.backward(l1 * out2 + l2 * other_out)