Lucas Paqueta's towering header inside the opening eight minutes put the Hammers in front before Roland Sallai prodded home an equaliser for the hosts four minutes after the restart.
However, the contest was decided in the 66th minute when Nayef Aguerd headed a James Ward-Prowse corner beyond goalkeeper Noah Atubolu to secure all three points for the reigning Europa Conference League champions.
David Moyes's side sit top of Group A with maximum points after two games, and their latest triumph has set a new club record for English clubs in Europe.
Indeed, West Ham have put together an exceptional 17-game unbeaten run in European competition, including 16 victories and one draw, surpassing the previous record of 16 games undefeated by Don Revie's Leeds United from 1968 and Bill Nicholson's Tottenham Hotspur from 1972.
West Ham's unbeaten run began back in August 2022 when they claimed a 3-1 first-leg win over Danish club Viborg in the Europa Conference League playoff round; the Hammers won the reverse fixture 3-0 to qualify for the group stage.
Moyes's men then won all six group games before winning six of their seven knockout fixtures including a 2-1 triumph in the final against Fiorentina to clinch their first European trophy for 58 years.
Reacting to West Ham's win over Freiburg and their new European record, Moyes told whufc.com: "I got told about the record yesterday and I was quite thrilled to even be level with the two managers who were in question, Don Revie and Bill Nicholson, and I have to say I was delighted with getting the win.
"The record is always really good to get, but more important was winning tonight, and getting those three points is so good, particularly when many would consider this the hardest game in the group."
Moyes heaped praise on Paqueta, who marked his 50th appearance for the Hammers with a man-of-the-match display in Germany, adding: "I thought we started the game great. I thought we pressed well. Jarrod Bowen and Lucas Paqueta did a great job for us up there and I think it as a brilliant early goal.
"It was a bit of an old-fashioned one in that he's gone on the outside, crossed it in the box and it was a great, centre-forward's leap from Paqueta. I loved the first goal. I thought it was really good and I really enjoyed it.
"You can be pulling your hair out at times, with some of the things he does, but we can all stand back and admire someone who has got terrific strength, great ball control, skills, and wants to make risky passes and try things. He's an incredibly talented footballer and tonight he showed that."
Discussing West Ham's competition in Group A, Moyes said: "We wanted to be strong in this game (against Freiburg). I see Freiburg and Olympiacos both as competitive and very difficult to beat in this group, and it's probably the most difficult group we've had in a European campaign so far.
"I just feel the boys are doing a brilliant job. We've come away from home, got a result, our run in Europe continues and we've done really well. Hopefully it keeps building."
West Ham will look to extend their unbeaten European run to 18 matches when they face Olympiacos in their third Group A fixture on October 26, but they will first turn their attention to Sunday's Premier League clash at home against Newcastle United.