Fewell, 52, was fired by the Giants earlier this month following five seasons as the team's defensive coordinator, including a victory in Super Bowl XLVI. The Giants finished No. 22 in scoring defense and No. 29 in yards allowed last season.
The 49ers parted ways with head coach Jim Harbaugh at the end of the season and promoted defensive line coach Jim Tomsula to head coach earlier this month.
Former 49ers defensive coordinator Vic Fangio left for the same position with the Chicago Bears earlier this week.
San Francisco hired Eric Mangini as its defensive coordinator on Thursday. Mangini has head coaching experience with the New York Jets and Cleveland Browns. He was also a defensive assistant with the New England Patriots.
- Brad Rowland