The Raiders will visit their Bay Area rival's stadium for the first time.
The 49ers are one of Oakland's eight road opponents for the 2018-19 season. They will also have the usual away games against AFC West rivals Denver, Kansas City and the Los Angeles Chargers, and will travel to Arizona, Baltimore, Cincinnati and Miami.
The Raiders will face teams from the AFC North and NFC West this season, plus other AFC teams that finished third in division play as Oakland did – which would mean Miami and Indianapolis.
Oakland will host its three divisional foes, as well as Cleveland, Indianapolis, the Los Angeles Rams, Pittsburgh and Seattle, which will be played in London.
The regular season starts Thursday, Sept. 6, and will end Dec. 30. The full schedule should be released in April, before the NFL draft.
The Raiders will look to improve on their 6-10 record from last season, which came a year after breaking their long playoff drought. They were 12-4 in 2016-17 but lost to the Houston Texans in their first postseason contest since 2002-03.
Their previous playoff game was Super Bowl XXXVII, losing to Tampa Bay and former coach Jon Gruden.
Gruden was re-hired by the Raiders in January after spending seven seasons with the Buccaneers and then going on to be a broadcast analyst with ESPN.