The crush happened on Saturday in Cotonou, Benin's economic capital, during qualifiers for the Africa Cup of Nations.
"There was an incident which caused the death of two people," Benin district attorney Jules Ahoga said in a statement.
One person died in the stands and another at hospital, it said, adding that an investigation was underway.
The Cheetahs of Benin played at home against the Teranga Lions of Senegal to secure a qualifying place. The teams drew 1-1.
A source at Benin's football federation confirmed the two deaths.
The stadium's gates had been ordered to be open free of charge to make access easier, the source said.
"It wasn't the federation which made it free, it's the state, through the ministry of sport," the source said.
Benin supporter Louis Nouwatin, 32, who was caught up in the crowds, blamed the crush on supporters "who wanted to push their way through so that they could grab a seat."
"We were trampled on mercilessly. The police were overwhelmed," he said. "You shouldn't go out to support the national team and go home in a coffin."
Six injured were admitted to hospital and four others to an area health centre, a hospital source told AFP.
A similar incident occurred in March 2019 during a match against Togo, when one person died and 13 were injured.