The reigning Champions League winners, who qualified for the round of 16 with two matches to spare, fielded a largely second-string team with the pressure on the visitors to secure third place in the standings and a Europa League spot.
Bayern had the upper hand but carved out only few scoring chances in the first-half, with top goalscorer Robert Lewandowski sidelined due to a minor injury.
The Bavarians came close with a Sule header and Choupo-Moting's back heel flick in the 53rd, before a double chance from Gnabry, who was denied by keeper Guilherme and volleyed the rebound narrowly wide.
Guilherme was beaten in the 63rd minute when Douglas Costa whipped in a corner and Sule rose above two defenders to drill a powerful header past the keeper.
Former Stoke City and Paris Saint-Germain attacker Choupo-Moting doubled the lead in 10 minutes from time to lift Bayern to 16 points. The Bavarians are joined in the knockout stage by Atletico Madrid while Lokomotiv finished bottom on three points.