Spin-flip inelastic electron tunneling spectroscopy in atomic chains