"This is love: not that we loved God, but that he loved us and sent his Son as an atoning sacrifice for our sins." -- 1 John 4:10
Maybe 1 John is not the one John who wrote the Gospels. I don't know. But he and Matthew are not saying the same thing.
From the Old Testament we know that God neither condoned sacrificing one's own, nor that anyone can atone for someone else's sins.