From gain- + -ward, or from an apheretic variant of Middle English agaynward, aȝenward, aȝeinward.
gainward