In methanol-to-hydrocarbon chemistry, methanol and dimethyl ether (DME) can act as methylating agents. Therefore, we focus on the different reactivity of methanol and DME towards benzene methylation in H-ZSM-5 at operating conditions by combining first principles microkinetic modeling and experiments. Methylation reactions are known to follow either a concerted reaction path or a stepwise mechanism going through a framework-bound methoxide. By constructing a DFT based microkinetic model including the concerted and stepwise reactions, product formation rates can be calculated at conditions that closely mimic the experimentally applied conditions. Trends in measured rates are relatively well reproduced by our DFT based microkinetic model. We find that benzene methylation with DME is faster than with methanol but the difference decreases with increasing temperature. At low temperatures, the concerted mechanism dominates, however at higher temperatures and low pressures the mechanism shifts to the stepwise pathway. This transition occurs at lower temperatures for methanol than for DME, resulting in smaller reactivity differences between methanol and DME at high temperature. Our theory-experiment approach shows that the widely assumed rate law with zeroth and first order in oxygenate and hydrocarbon partial pressure is not generally applicable and depends on the applied temperature, pressure and feed composition.