Actually, it’s the same context, only poorly separated by a chapter division. And the “dead” in 4.6 are the same dead in 3.19-20.
18 Christ suffered for our sins once for all time. He never sinned, but he died for sinners to bring you safely home to God. He suffered physical death, but he was raised to life in the Spirit. 19 So he went and preached to the spirits in prison—20 those who disobeyed God long ago when God waited patiently while Noah was building his boat. Only eight people were saved from drowning in that terrible flood. 21 And that water is a picture of baptism, which now saves you, not by removing dirt from your body, but as a response to God from a clean conscience. It is effective because of the resurrection of Jesus Christ.
22 Now Christ has gone to heaven. He is seated in the place of honor next to God, and all the angels and authorities and powers accept his authority. 1 So then, since Christ suffered physical pain, you must arm yourselves with the same attitude he had, and be ready to suffer, too. For if you have suffered physically for Christ, you have finished with sin. 2 You won’t spend the rest of your lives chasing your own desires, but you will be anxious to do the will of God. 3 You have had enough in the past of the evil things that godless people enjoy—their immorality and lust, their feasting and drunkenness and wild parties, and their terrible worship of idols.
4 Of course, your former friends are surprised when you no longer plunge into the flood of wild and destructive things they do. So they slander you. 5 But remember that they will have to face God, who will judge everyone, both the living and the dead. 6 That is why the Good News was preached to those who are now dead—so although they were destined to die like all people, they now live forever with God in the Spirit.