High nonradiative recombination, low diffusion length and band tailing are often associated with a large open circuit voltage deficit, which results in low efficiency of Cu2ZnSnS4 (CZTS) solar cells. Recently, cation substitution in CZTS has gained interest as a plausible solution to suppress these issues. However, the common substitutes, Ag and Cd, are not ideal due to their scarcity and toxicity. Other transition-metal candidates (e.g., Mn, Fe, Co, or Ni) are multivalent, which may form harmful deep-level defects. Magnesium, as one of the viable substitutes, does not have these issues, as it is very stable in +2 oxidation state, abundant, and nontoxic. In this study, we investigate the effect of Mg incorporation in sulfur-based Cu2ZnSnS4 to form Cu2MgxZn1-xSnS4 by varying x from 0.0 to 1.0. These films were fabricated by chemical spray pyrolysis and the subsequent sulfurization process. At a high Mg content, it is found that Mg does not replace Zn to form a quaternary compound, which leads to the appearance of the secondary phases in the sample. However, a low Mg content (Cu2Mg0.05Zn0.95SnS4) improves the power conversion efficiency from 5.10% (CZTS) to 6.73%. The improvement is correlated to the better carrier-transport properties, as shown by a lesser amount of the ZnS secondary phase, higher carrier mobility, and shallower acceptor defects level. In addition, the Cu2Mg0.05Zn0.95SnS4 device also shows better charge-collection property based on the higher fill factor and quantum efficiency despite having lower depletion width. Therefore, we believe that the addition of a small amount of Mg is another viable route to improve the performance of the CZTS solar cell.