And the Reds did it the hard way after going behind to a 10th-minute strike from Will Griggs who fired pasty Adam Davies from six yards.
Paul Heckingbottom’s side soon rallied, however, and had a couple of chances of their own to level before they got back on even terms from the penalty spot in 33rd minute, Stephen Warnock’s foul on Ashley Fletcher allowing Sam Winnall to step up and beat Lee Nicholls from 12 yards.
Shortly before the break the visitors - knowing a win was required to seal a top-six finish - got themselves in front when Winnall struck his second.
It got even better for the JP Trophy winners in the 56th minute when Conor Hourihane fired into the corner of the net, thanks to what seemed like a slight deflection.
But, even when Josh Brownhill increased Barnsley’s lead with an exquisite 20-yard free-kick in the 74th minute, there was still going to be cause for a double celebration at the end with Wigan’s players able to enjoy a party atmosphere having already confirmed their champion status.
Now all that is required is for Barnsley to join them via the lottery of the play-offs, the first hurdle being a two-legged semi-final against third-place finishers Walsall.
Wigan Athletic: Nicholls; Daniels, Morgan, Pearce, Warnock; Power, Perkins, McCann; Jacobs, Grigg, Wildschut. Unused substitutes: Jaaskelainen, Morsy, McAleny, Barnett, Colclough, Vukic, Wabara.
Barnsley: Davies; Scowen, Roberts, Mawson, G Williams; Isgrove, Brownhill, Hourihane, Hammill; Winnall, Fletcher. Unused substitutes: White, Townsend, Toney, Nyatanga, McCourt, Tuton, Chapman.
Referee: T Harrington (Cleveland).