On Good friday, when the dead arose, did they get baptized? Maybe but practically speaking, who was going to baptize them? The Apostles and disciples were all hiding, St John the Baptist was dead, which only leaves St John the Apostle as the official priest. Unless the dead stayed alive for a few days til Easter Sunday to be baptized by the Risen Christ? Maybe, i've just never heard any saint propose this happening.
So here's the account from St. Matthew 27:52-53
And the graves were opened: and many bodies of the saints that had slept arose, And coming out of the tombs after his resurrection, came into the holy city, and appeared to many.
So this does indeed state that they came out of the tombs "after His resurrection".
Certainly Our Lord would have arisen first before any of the others had been resurrected and the OT just would not have preceded Him in resurrection.
While the earlier sources mentioned for these dead rising in order to be baptized included the Gospel of Nicodemus (which could very well be gnostic), the Shepherd of Hermas is generally considered authentically Christian.
For the longest time (before I became a "Feeneyite" and came to understand the necessity of the Sacrament of Baptism), this passage always puzzled me. WHY would these rise from the dead? For what purpose? Just to create some kind of spectacle? Really the only answer that makes any sense to me is that they needed to be baptized with water ... and for that to happen they needed to have their physical bodies back, at least temporarily.
This to me is very strong evidence for the absolute requirement for the Sacrament of Baptism, and we have examples of the saints raising people back to life in order to baptize them, in situations where they obviously would have been just waived right through by a BoD. One was a devout Christian Black woman (I forget the saint) who assisted at Mass every day and regularly received the Sacraments, but it turned out she had never been baptized, and she reported having bee turned away from Heaven for lacking the necessary wedding garment ... and sent back through the intercession of the saint. But if anyone would have been given a pass, it would have been the OT just, as Baptism wasn't required back in their day. This clearly militates against any "necessity of precept" contention, since this makes it seem as if was in fact some ontological necessity to be physically baptized with actual water on their bodies.