It’s important to realize that the only non-Catholic baptisms that are recognized are those that are both Trinitarian, and recognize that this action of Baptism is a membership action of bringing the person into Christ’s Church, and washing them clean from their sins.
Without those elements being at least implicitly present, no baptism has taken place. There are many Protestant organizations whose baptisms are also not recognized, because they don’t believe that baptism washes away sins, or else they don’t believe that baptism is the rite of membership into the Church, or else they don’t use the Trinitarian formula.
When a non-Catholic performs an emergency Baptism, he does so intending to do what Catholics do when they baptize - what this means is that, although he may or may not understand what membership in the Church is, or what the washing away of sins is, or why he should use the words “in the name of the Father and of the Son and of the Holy Spirit” while pouring the water, he is not explicitly denying any of this, either, or intending to do something other than a valid baptism into the Catholic Church.