The Ruderman-Kittel-Kasuya-Yosida (RKKY) interaction mediates collinear magnetic interactions via the conduction electrons of a nonmagnetic spacer, resulting in a ferro- or antiferromagnetic magnetization in magnetic multilayers. Recently it has been discovered that heavy nonmagnetic spacers are able to mediate an indirect magnetic coupling that is noncollinear and chiral. This Dzyaloshinskii-Moriya-enhanced RKKY interaction causes the emergence of a variety of interesting magnetic structures, such as skyrmions and spin spirals. Here, we show by spin-polarized scanning tunneling microscopy that the interchain coupling between manganese oxide chains on Ir(001) can reproducibly be switched from chiral to collinear antiferromagnetic by increasing the oxidation state of ${\mathrm{MnO}}_{2}$, while the reverse process can be induced by thermal reduction. The underlying structure--property relationship is revealed by low-energy electron diffraction intensity analysis. Density functional theory calculations suggest that the magnetic transition may be caused by a significant increase of the Heisenberg exchange which overrides the Dzyaloshinskii-Moriya interaction upon oxidation.