Does one who was baptized in a faith not recognized by God have to be baptized over again when they are saved?
I am not sure of any faiths besides Christianity and Judaism that practice immersion. There may be others, however. The difference would be the stated purpose of immersion. For the Jews it is purification. For Christians (as stated in the Bible) it is forgiveness of sins and salvation. (See What Is Sin? and What Does the Bible Say About..Baptism?)
The question should not be whether they have to be baptized over again “when they are saved” but whether they need to be baptized again to be saved. The scriptures indicate that faith and repentance (and possibly public confession of that faith) accompany or precede immersion. If someone was put under water without faith, repentance, or the intent of having their sins removed, then it would appear that they were not scripturally immersed and would need to be baptized again for the proper reasons.
And it came to pass, that, while Apollos was at Corinth, Paul having passed through the upper coasts came to Ephesus: and finding certain disciples, He said unto them, Have ye received the Holy Ghost since ye believed? And they said unto him, We have not so much as heard whether there be any Holy Ghost. And he said unto them, Unto what then were ye baptized? And they said, Unto John's baptism. Then said Paul, John verily baptized with the baptism of repentance, saying unto the people, that they should believe on him which should come after him, that is, on Christ Jesus. When they heard this, they were baptized in the name of the Lord Jesus. (Acts 19:1-5)