The Bundesliga outfit netted in the 81st minute of the contest, with Gregoritsch turning a low shot from Roland Sallai into the back of the net from close range to ensure that the German team will take a narrow lead into the second leg of their encounter in London on March 14.
Freiburg had a chance to take the lead inside the first 30 seconds, with Sallai meeting a dangerous cross from the right, but West Ham defender Vladimir Coufal made an excellent block.
The away side's first attempt of the night came in the 16th minute, with Jarrod Bowen trying his luck, but the Englishman saw his effort kept out by Freiburg goalkeeper Noah Atubolu.
The hosts had another half-chance in the 19th minute through Maximilian Eggestein, but the midfielder's free kick from distance was always rising over the West Ham goal.
Mohammed Kudus and Sallai then took it in turns to miss the target at either end, with the score still goalless at the mid-point of the opening half of action in Germany.
Nicolas Hofler had an opportunity to send Freiburg ahead in the 31st minute of the contest after breaking into a dangerous position, but his effort was straight at West Ham goalkeeper Lukasz Fabianski, before Bowen volleyed wide of the target down the other end of the field.
West Ham made a bright start to the second period, with Kudus forcing Atubolu into a save after working space in a dangerous area and then unleashing a strike.
Coufal was next to try his luck for the Hammers in the 55th minute, but his effort was wide of the left-hand post, before Christian Gunter missed the target down the other end of the field.
Vincenzo Grifo then fired over the West Ham goal in the 59th minute, before Lucas Paqueta passed up a good opportunity down the other end, heading a pass from Kudus over the crossbar.
West Ham had another opening in the 64th minute through Bowen, but his curling strike was excellently kept out by the Freiburg goalkeeper during an open period of the match.
Konstantinos Mavropanos then headed a corner wide of the post in the 67th minute, with West Ham starting to force the issue heading towards the final 20 minutes of the first leg.
Fabianski kept out a header from Kiliann Sildillia in the 74th minute, before James Ward-Prowse was denied by Atubolu, with the midfielder failing to make the most of a good opportunity inside the home team's penalty box.
Freiburg managed to make the breakthrough in the 81st minute of the contest through Gregoritsch, who tapped a Sallai shot into the back of the net from close range to spark jubilant scenes inside the stadium.
There was a late check for a West Ham penalty deep into stoppage time, with Noah Weisshaupt handling an attempt from Kalvin Phillips, but referee Alejandro Hernandez, who had been sent to the monitor, stuck with his original decision not to award a spot kick during a controversial finish in Germany.