An early strike by RB Leipzig's Timo Werner coupled with Osama Hawsawi's own goal before half time put the world champions in command, before a late goal by Taisir Al-Jassim made the dying stages a contest.
Joachim Low's side took the lead in the eighth minute when Marco Reus picked out Werner inside the box and the forward fired one into the net from close range, his strike going in off the underside of the crossbar.
The Germans dominated the opening stages and came within a lick of paint of a second goal moments later when Reus struck a half-volley from 25 yards out, beating the goalkeeper but not the left upright.
The hosts piled bodies forward on the half-hour mark, allowing Thomas Muller and Reus to combine before providing a lofted pass for Werner to head towards goal, his effort missing the mark by mere inches.
Germany, however, doubled their lead just before the break when Werner gave his marker the slip in the box and played a low pass across the face of goal, which Muller missed at full stretch but hapless Hawsawi bundled over the line to score at the wrong end.
Low's men were back on the front foot early in the second period, and they nearly did further damage when Toni Kroos's dangerous cross found the head of Mats Hummels inside the box, but the defender's effort was too high.
Al-Mayoof was called into action again moments later to keep out a vicious strike from Julian Draxler as the Paris Saint-Germain forward got goalside of his marker and went for goal, testing the visiting goalkeeper.
The Saudis staged another rare attack just after the hour as Salem Al-Dawsari found space in the final third and powered forward, leaving him with only the goalkeeper to beat, but he struck his shot against the advertising boards behind the goal.
Germany substitute Julian Brandt blew the chance to make an impact off the bench in the 77th minute when he met a cross at the back post unmarked, but the Leverkusen man sliced his half-volley wide.
There was drama in the closing stages as the Saudis were awarded a penalty when Khedira was adjudged to have hacked Taisir Al-Jassim in the box, but Mohammad Al-Sahlawi's resulting strike from 12 yards was saved by Marc-Andre ter Stegen.
The Barcelona stopper was, however, unable to keep out Al Jassim on the rebound as the visitors pulled one back with five minutes left to play.
Saudi Arabia should have snatched an equaliser in stoppage time when Al Jassim raced clean through on goal, but he chose to pass when he should have pulled the trigger, allowing Hummels to track back and make a vital interception.
Both sides' next matches will be at the World Cup finals, with the Saudis taking on hosts Russia in their group opener and Germany playing Mexico.
GERMANY (4-2-3-1): Neuer (Ter Stegen 45'); Kimmich (Ginter 81'), Hummels, Boateng (Sule 45'), Hector; Kroos, Khedira; Reus (Gundogan 57'), Muller, Draxler (Brandt 74'); Werner (Gomez 62')
SAUDI ARABIA (4-2-3-1): Al-Mayoof; Al Shahrani, Hawsawi (Ali Al-Bulayhi 83'), Otayf (Al-Moqahwi 75'), Al-Harbi (Al-Burayk 45'); Ateef, Al Faraj (Al-Khaibari 91'); Al Shehri, Al Dawsari (Bahbir 87'), Al Jassam; Al Muwallad (Al-Sahlawi 62')