Implementation of antiferromagnetic compounds as active elements in spintronics has been hindered by their insensitive nature against external perturbations which causes difficulties in switching among different antiferromagnetic spin configurations. Electrically controllable strain gradient can become a key parameter to tune the antiferromagnetic states of multiferroic materials. We have discovered a correlation between an electrically written straight-stripe mixed-phase boundary and an in-plane antiferromagnetic spin axis in highly elongated La-5%-doped BiFeO3 thin films by performing polarization-dependent photoemission electron microscopy in conjunction with cluster model calculations. A model Hamiltonian calculation for the single-ion anisotropy including the spin-orbit interaction has been performed to figure out the physical origin of the link between the strain gradient present in the mixed-phase area and its antiferromagnetic spin axis. Our findings enable estimation of the strain-gradient- induced magnetic anisotropy energy per Fe ion at around 5 x 10(-12) eV m, and provide a pathway toward an electric-field-induced 90 degrees rotation of antiferromagnetic spin axis at room temperature by flexomagnetism.