Answer
See the detailed answer below.
Work Step by Step
If the two gases are perfectly isolated from the surroundings, then the heat loss from one gas is then absorbed by the other.
Hence,
$$Q_1+Q_2=0$$
Thus,
$$Q_1=-Q_2$$
Another approach, if the system is perfectly isolated then the total thermal energy of the two gases remains constant.
Hence,
$$\Delta E_{th,1}+\Delta E_{th,2}=0$$
Recalling that $\Delta E_{th}=Q+W$, hence
$$Q_{1}+W_1+Q_2+W_2 =0$$
And since the volume of the gases, in the discussion of 18.43, is constant, then the work done on any of them is zero.
$$Q_{1}+0+Q_2+0=0$$
Thus,
$$Q_1=-Q_2$$