The formation process of the two Martian moons, Phobos and Deimos, is still debated with two main competing hypotheses: the capture of an asteroid or a giant impact onto Mars. In order to reveal their origin, the Martian Moons eXploration (MMX) mission by Japan Aerospace Exploration Agency (JAXA) plans to measure Phobos’ elemental composition by a gamma-ray and neutron spectrometer called MEGANE. This study provides a model of Phobos’ bulk elemental composition, assuming the two formation hypotheses. Using the mixing model, we established a MEGANE data analysis flow to discriminate between the formation hypotheses by multivariate analysis. The mixing model expresses the composition of Phobos in 6 key lithophile elements that will be measured by MEGANE (Fe, Si, O, Ca, Mg, and Th) as a linear mixing of two mixing components: material from Mars and material from an asteroid as represented by primitive meteorite compositions. The inversion calculation includes consideration of MEGANE’s measurement errors (EP) and derives the mixing ratio for a given Phobos composition, based on which the formation hypotheses are judged. For at least 65% of the modeled compositions, MEGANE measurements will determine the origin uniquely (EP = 30%), and this increases from 74 to 87% as EP decreases from 20 to 10%. Although the discrimination performance depends on EP, the current operation plan for MEGANE predicts an instrument performance for EP of 20—30%, resulting in 70% discrimination between the original hypotheses. MEGANE observations can also enable the determination of the asteroid type of the captured body or the impactor. The addition of other measurements, such as MEGANE’s measurements of the volatile element K, as well as observations by other MMX remote sensing instruments, will also contribute to the MMX mission’s goal to constrain the origin of Phobos.