The shootings occurred shortly after the 49ers' 17-3 victory, police Sgt. Michael Andraychak said.
A 24-year-old man was treated at San Francisco General Hospital with life-threatening injuries, and a 20-year-old man was hospitalized and was expected to survive, Andraychack told The Associated Press. Their names have not been released.
Police Sgt. Frank Harrell that the 24-year-old man was wearing a T-shirt with a derogatory comment about the 49ers and was shot two to four times in the stomach, according to reports in the Oakland Tribune and the San Francisco Chronicle. He drove his truck to a gate and stumbled to security, Harrell said.
The other victim was shot earlier and had superficial face injuries, Harrell said.
"We are treating it as separate shootings, but we believe they are related," Harrell told reporters outside the stadium.
Harrell said police took a man in a Raiders jersey off a party bus before it left the stadium and were calling him a suspect.
The suspect and the two victims had all attended the game, Harrell told the newspapers.
The 49ers issued a statement acknowledging the shootings and the investigation, but offering no further details.
There was at least one fight in the lower bowl of the stadium during the game, but it was no immediate indication that it was connected to the postgame shootings.
The violence was not the first involving a San Francisco sports team's game this year.
In March, San Francisco Giants fan Bryan Stow was severely beaten by two men in Los Angeles Dodgers gear outside Dodger Stadium after the teams' season opener. He remains in San Francisco hospital with in serious condition with brain injuries. Two suspects have been charged in the case.