Footage posted on Dortmund’s Twitter account showed Haller being embraced on the touchline by coach Edin Terzic before he entered the field to applause.
England international Jude Bellingham welcomed his club team-mate’s return by tweeting: “What a sight, what a man.”
Ivory Coast international Haller, who made more than 50 appearances for the Hammers between 2019 and 2021, last week resumed training with Terzic’s squad at their camp in Marbella.
“I’m doing well. It’s been a tough six months,” the 28-year-old said on Monday, according to the club website.
“I’m naturally very happy to be able to be here with the lads and train. For me, my return was simply a matter of time, hence why I always kept going.
“It’s the best feeling you can have (returning to the pitch). When you have this illness, you don’t know what your future looks like. I could only concentrate on the next day. I worked a lot so that I can now participate in everything.”
Dortmund won the friendly 5-1 thanks to goals from Felix Passlack, Karim Adeyemi and Nico Schlotterbeck, plus Donyell Malen’s late double.
The club return to competitive action at home to Augsburg on Sunday, January 22.
“A lot of attention is being paid to how my body reacts to the training,” added France-born Haller, who is still awaiting his Dortmund debut.
“My values are now being closely monitored. I will get involved in everything as long as I feel well, but we need to keep an eye on all the data.
“I’m looking forward to playing at the stadium and in front of the Yellow Wall (Dortmund’s fans). That’s the goal.”