Christians, Jews and Muslims came together at the city's Gothic landmark church Frauenkirche for a non-denominational service, at which Cardinal Reinhard Marx said mistrust and fear must not have the last word.
Dhari Hajer, who chairs the city's Muslim council, also warned Germany against falling into a "vicious cycle of hatred and violence" as the country seeks to come to terms with a series of assaults over the past two weeks.
The gun rampage at a Munich shopping mall on July 22 by 18-year-old David Ali Sonboly came four days after a 17-year-old Afghan refugee seriously wounded five with an axe attack.
Two days later, Germany was hit by a kebab knife assault that left one dead and a suicide bomb attack that wounded a dozen people.
Addressing the Bavarian parliament in the second of the day's memorial events, Gauck said attackers and terrorists "will not force us to hate as they hate."
"They will not hold us captive through constant fear. We will remain what we are, a humane community that shows solidarity," he said.
At the same time, Gauck said the attacks also called for society to reflect on what drove the perpetrators to the violence.
Noting that the assaults were often planned ahead in time, he said "society must not allow these young people to be left alone nor to tolerate their marginalisation."
Investigators have said that Sonboly was a depressed teen who was obsessed with mass killings and had long struggled with his mental health.
He also appeared to have been a victim of bullying by other pupils at his school, and had filed a complaint against three of his tormentors in 2012.
In an interview with Bild am Sonntag, the teenager's father Masoud Sonboly blamed himself for not noticing how his son had shut himself off and sought refuge in violent computer games.
At the same time, he also called into question the teacher's and classmates' actions.
Sonboly said he had spoken to the teacher about the bullies who targeted his son, but said no action was taken.
"Our lives in Munich have been destroyed," he said, adding that "we get death threats, my wife has been crying over the past week."