several key things you pointed out.
The niners are a very physical team and it starts with both of their lines. They have made huge investments in the DL and OL and focus has been on physiciallity of both. their DL is or almost violent with the way they attack.
their defensive success is predicated on pass defense and rushing with front 4, which they do a really good job and then dropping 7 into coverage as you said take away passing lanes, specially with their LBs.
Their offensive success is also predicated on their running game. and the ability of the backs catching and RACs. Sameul is physical and is at times like a RB from the backfield. McCaffrey fits their offense to a T. they run a zone blocking scheme and he can wiggle his way through, as if they had Henry, they would not necessarily see as much success.
the way to beat them is to run the ball, force them to respect the run and not be predictable on 2nd, 3rd downs. its not necessarily averaging 4 yards a carry, but averaging 3.5 to four, allows you to run even on second downs and force them to dedicate more of their LBs to stopping the run. which in turn opens the passing game. in our earlier game this year, the drive we scored a TD, was just that. we had some success running the ball, which in turn opened the passing game. the passing game has to challenge them everywhere in the field, their defense has to be forced to defend the whole field forcing their Safties and LBs having to make decisions.
ofcourse all of this is predicated on stopping their pass rush. dedicating additional players to provide pass protection is more important than having more WRs enroute.
Right now SF is best team in the league, despite their 3 game losing streak. in those three losses, McCaffrey was held in check with 43, 45 and 50 yards. and all those teams had some to good success running against them. that put their defense having to focus on stopping the run and then left passing lanes open. Minn. provided excellent pass protection and they attacked them all over the field.