A previously developed Monte Carlo code has been extended to the X-ray microanalysis in a (scanning) transmission electron microscope of plan sections, consisting of bilayers and triple layers. To test the validity of this method for quantification purposes, a commercially available NiOx (x ∼ 1) thin film, deposited on a carbon layer, has been chosen. The composition and thickness of the NiO film and the thickness of the C support layer are obtained by fitting to the three X-ray intensity ratios I(NiK)/I(OK), I(NiK)/I(CK), and I(OK)/I(CK). Moreover, it has been investigated to what extent the resulting film composition is affected by the presence of a contaminating carbon film at the sample surface. To this end, the sample has been analyzed both in the (recommended) “grid downward” geometry and in the upside/down (“grid upward”) situation. It is found that a carbon contaminating film of few tens of nanometers must be assumed in both cases, in addition to the C support film. Consequently, assuming the proper C/NiOx/C stack in the simulations, the Monte Carlo method yields the correct oxygen concentration and thickness of the NiOx film.