Mainstream Jews have been praying for dead for at least one hundred years before Christ. The Maccabean chronicles explicitly describes that prayer was offered for the dead and that one could arrange sacrifice at the Temple on behalf of the dead (2 Mac 12:42-45). Anyone today can go to a Jewish synagogue and learn that all Jews pray to God for the benefit of the departed.
The Jewish Talmud may be thought to indicate the state of "Purgatory" in Sabbath 33b and Rosh HaShanah 16b-17a; a similar belief in the efficacy of prayers for the dead is manifest in the Mourner's Kaddish which is prayed for 11 months after a loved one dies.
All this shows that prayer for the faithful departed is not a pagan compromise or a late medieval invention. Rather it is the Jewish custom that long predates the advent of Christ.