The purpose of this paper is the derivation of a discrete version of the stochastic Gronwall lemma involving a martingale. The proof is based on a corresponding deterministic version of the discrete Gronwall lemma and an inequality bounding the supremum in terms of the infimum for discrete time martingales. As an application the proof of an a priori estimate for the backward Euler-Maruyama method is included.