The 27-year-old, who had surgery on his shoulder last year, will join on July 1 after his contract expires with the Bundesliga runners-up.
"I'm excited to have Mahmoud in my team. I wanted him when I was at Sassuolo and I'm sure he is going to be a top player for us," manager Roberto De Zerbi said.
Dahoud has two senior caps for Germany after making his international debut against Turkey in 2020.
Brighton will be playing in Europe for the first time next season after they finished sixth to qualify for the Europa League.
"He's a quality player, he's got lots of experience playing at a high level in Germany with great experience in Europe too," technical director David Weir said.