Striker Uche Ikpeazu scored a dramatic late winner as Port Vale won an entertaining game at Vale Park.
Vale were on top in a first-half where midfielder Anthony Grant excelled and spoilt only by over-zealous refereeing.
It was Grant who put Vale on top with a fine drive just after the half-hour mark.
Vale went 2-0 up just after the hour mark when the hard-working Louis Dodds netted.
But almost immediately, Wigan equalised through McCann and when Barnett made it 2-2 on 83 minutes a draw looked likely.
However, there was more drama to come as Barnett was dismissed for hauling down Andoh when clean through and then Ikpeazu scored in the last minute to earn Vale all three points.
It was an excellent all-round performance by the Valiants with Grant, Ikpeazu and Duffy excellent but the rest of the team also putting in a high standard of performance.
Vale: Alnwick, Purkiss, Duffy, Streete, Dickinson, Grant, Foley (McCourt), Moore, Dodds, Andoh, Ikpeazu (Daniel)
Subs: Johnson, Leitch-Smith, Birchall, Lloyd, Inniss