The visitors enjoyed a good spell of possession early on and were the first to threaten when Will Grigg saw his low shot deflected wide.
Jordan Spence then shot straight at goalkeeper Mark Howard.
United’s Chris Basham tried a long-range effort which was saved by David Martin before Stefan Scougall shot wide.
As the hosts continued to press, Bob Harris sent over a fine first-time cross which just evaded Basham as the ball flashed across the face of goal.
Paddy McCarthy also headed over from a good position.
Shortly after the restart, Scougall tested Martin with a firm shot.
Antony Kay went close for the visitors with a diving header which was cleared off the line by Jamie Murphy.
Alli struck the decisive goal in the 87th minute, finding the net from close range after Howard could only parry Danny Green’s low driven free-kick.
Green was sent off deep into stoppage time after receiving a second yellow card.