Leigh Leopards reached the Betfred Challenge Cup semi-finals for the second time in three seasons with a comeback win at Wakefield Trinity.