The midfielder, who turned 22 this month, had scored in three successive matches for the Stags before their midweek victory at Rochdale.
And although he wasn't on the scoresheet at Boundary Park at the weekend, he supplied the pass from which Rhys Oates equalised before George Lapslie - an 81st-minute replacement for Longstaff - scored a late winner which put the Yellows four points behind the automatic promotion places with three games in hand.
Bristol Rovers are also pushing for promotion from the same division, but their play-off hopes took a hit with a 1-0 defeat at Carlisle United, with Elliot Anderson playing the full game.
Joe White missed Hartlepool United's 2-0 defeat at Northampton due to injury while in League One, Matt Bondswell was once again an unused substitute for Shrewsbury as they beat Lincoln City 1-0.