On-surface synthesis is emerging as a highly rational bottom-up methodology for the synthesis of molecular structures that are unattainable or complex to obtain by wet chemistry. Here, oligomers of meta-polyaniline, a known ferromagnetic polymer, were synthesized from para-amino-phenol building-blocks via an unexpected and highly specific on-surface formal 1,4 Michael-type addition at the meta position, driven by the reduction of the aminophenol molecule. We rationalize this dehydrogenation and coupling reaction mechanism with a combination of in situ scanning tunneling and non-contact atomic force microscopies, high-resolution synchrotron-based X-ray photoemission spectroscopy and first-principles calculations. This study demonstrates the capability of surfaces to selectively modify local molecular conditions to redirect well-established synthetic routes, such as Michael coupling, towards the rational synthesis of new covalent nanostructures.