The Magpies reached the third round of the Emirates FA Cup for the first time with an incredibly come-from-behind victory at League One pacesetters Peterborough United.