The physical and chemical conditions under which Martian core formation took place are not well constrained. We modeled the pressure, temperature, and oxygen fugacity conditions under which it would be possible to match the inferred depletions of moderately siderophile elements Ni, Co, W, Mo, Ga, P, and Ge in the Martian mantle, using new constraints on their metal-silicate partitioning behavior. Using literature metal-silicate partitioning data, we characterize the dependence of the metal-silicate partition coefficients (D) on the temperature, pressure, oxygen fugacity, and composition of the silicate melt and the metal using a uniform parameterization approach for each element. Our results show that it is impossible to simultaneously account for the Martian mantle depletions of moderately siderophile elements if the Martian core sulfur content exceeds 10.5 wt % at reducing conditions (1 log unit below the iron-wüstite (IW) buffer). At 10.5 wt % core S, the conditions that best satisfy Martian mantle abundances of the seven siderophile elements are a mean pressure of 13(±1) GPa at 2330 K, corresponding to the presence of a magma ocean at least 1000 km deep during Martian core formation. More oxidizing conditions than the iron-wüstite buffer as suggested by iron meteorites are inconsistent with mantle siderophile element abundances. Extension of our approach to the highly siderophile elements Ru, Pd, Re, Ir, and Pt shows that their Martian mantle abundances are orders of magnitude too high to be accounted for by metal-silicate equilibration at high pressure and high temperature in a magma ocean, requiring a “late veneer” stage after core formation.