Crystal Palace overcame an embarrassing deficit at home to Bolton Wanderers to secure their FA Cup progression with a 2-1 win.
James Henry got the game’s opening goal as he looped a sensational effort in the top corner from range just two minutes into the second half.
It was 1-1 with 22 minutes to go as Mathieu Flamini’s inviting cross was powered home by Christian Benteke.
Benteke then completed the turnaround nine minutes later, as he controlled Townsend’s cross and fired home for his tenth goal of the season.
They will next host Manchester City in the competition’s next stage, but more important to Allardyce will have been overseeing his first victory since his appointment and the confidence he will hope they take into the Premier League.
The manager had made no secret of the fact he did not consider the cup a priority and would therefore field a weakened team but even if he retained only four of those selected in Saturday’s 3-0 defeat at West Ham, his XI looked capable of overcoming the club at which he built his reputation.
Regardless, during an uninspiring first half between what appeared two evenly-matched teams, it was Bolton who provided the first attacking threat.
After a run down the left, Zach Clough cut the ball back to Josh Vela and the midfielder sent a powerful shot just wide of the right post.
Palace had little more than probed the visitors’ settled defence with a through-ball from former Bolton winger Lee Chung-yong when Sulley Kaikai – starting his first game for the club – drew a foul from Jay Spearing on the edge of the area.
In what perhaps demonstrated the low confidence of the more senior Andros Townsend and Loic Remy, the 21-year-old then took responsibility for the free-kick and came within inches of the top right corner when he sent a curling effort just by the angle.
By half-time, Joe Ledley had been booked after handling the ball – sending it into the goal – from Kaikai’s cross, and Martin Kelly had had a header saved by Ben Alnwick, but beyond Kaikai’s energy there was little to give the hosts cause for optimism.
It was only three minutes into the second half when Henry – accused of being wasteful in front of goal this season – with little build-up or pressure unexpectedly curled into the top-right corner beyond Julian Speroni.
Palace continued to labour, but 14 minutes later Allardyce – perhaps sensing the potential damage to morale caused by another defeat – made a triple substition, replacing Damien Delaney, Ledley and the ineffective Remy with James Tomkins, Jason Puncheon and Benteke.
After a further six minutes, Mathieu Flamini found space on the right wing to cross towards the £27million Benteke, and from within the penalty area the striker produced a trademark powerful header beyond Alnwick and into the back of the net.
Seizing on their momentum, Townsend did similarly on the left, this time sending a low ball towards the 26-year-old, who from a similar position classily controlled the ball before calmly finishing to secure a crucial win 13 minutes from time.