Matt. 5:44-45 - Jesus tells us to pray for (to mediate on behalf of) those who persecute us. God instructs us to mediate.
This is a perfectly good verse about prayer, but it has nothing to do with praying to the dead.
The larger concept of "praying to" the dead is one of perspective. The Catholic perspective is that we are one kingdom and one body of Christ whether in this life or the next. We are still in communion with the saints (I believe it likely you say the same in your own Creed).
Therefore, just as I might come to you and ask you to pray for me, we do the same with the Saints and elicit their prayers and intercessions. We worship no one but God.