Seventh-placed Vikings went into the break 8-0 ahead thanks to two tries from Corey Thompson.
Liam Farrell's converted score brought Warriors back to within two against a side who defended stoutly despite at one stage having two in the sin-bin.
Wigan turned down a late chance for goal, but the visitors held out.
Shaun Wane's side need only one point to confirm a top-four finish, but decided against trying to draw the match when they won a 79th-minute penalty.
They decided to run it and, after it came to nothing, Widnes saw the clock down.
Wigan: S Tomkins, Charnley, Gelling, Sarginson, Tierney, Williams, Shorrocks, Sutton, Powell, Flower, Farrell, Bateman, Isa.
Replacements: Tautai, Gildart, Nuuausala, Bretherton.
Widnes: Hanbury, Thompson, Dean, Runciman, Marsh, Mellor, Brown, Burke, White, Buchanan, Whitley, Houston, Cahill.
Replacements: J Chapelhow, Dudson, Heremaia, Farrell.
Referee: Phil Bentham (RFL)
Widnes Vikings produced a superb defensive display to beat Wigan and leave Warriors still waiting to confirm their Super League play-off place.