Dennis Adeniran and Ryan Astley were also on target as the 2018/19 winners went three points clear of second-placed Watford, whom they face in their final match on 21 February.
Plymouth remain bottom of Group B but still have a chance of progressing if they beat Fulham on 25 February.
A Josh Davison hat-trick helped Charlton Athletic defeat Colchester United 4-1 to top Group A and book their spot in the knockout stages.
James Vennings also scored for the Addicks from the penalty spot, with Sammie McLeod netting a consolation for the visitors.
The result also means second-placed Reading qualify for the last 16. They and Charlton will face off on 24 February for the right to go through as group winners.
Colchester and bottom-club Swansea City cannot progress.
Allan's 13th goal of the season lifts the Magpies to second and within a point of the Baggies.
Hull City and Scunthorpe United are third and fourth respectively but have matches in hand.