The result leaves Wigan three points from safety, with just two games remaining.
After a nervy start, the home side started to dominate the game, without really threatening the goal, that was until the stroke of half-time, when Wigan took the lead.
Swansea came out much stronger after the break and equalised through Angel Rangel, but Wigan went ahead again a minute later. They then missed a good chance to go 3-1 up before Swansea equalised again.
Some poor Wigan defending allowed Dwight Tiendalli to score the winner for Swansea, with the Latics unable to find another goal in the final fifteen minutes.
See how the game unfolded with Sports Mole's live text commentary below.
7.28pmIt seems that Roberto Martinez has gone with a very attacking lineup, knowing that this is a must-win game. He's without Jean Beausejour though, who has been impressive for the Lactics down the left this season.
7.30pmThey do have the in-form Shaun Maloney in the team though, who could be very important for Wigan tonight. There is also the youngster Callum McManaman who scored a dramatic winner against West Bromwich Albion at the weekend.
7.32pmSwansea start with Itay Shechter up front, in place of Michu. The Isreali striker has not scored for the Swans yet and after being preferred to Luke Moore, could tonight be the night he breaks his duck?
7.34pmAs well as a relegation battle to be concerned with, Wigan face Manchester City in the FA Cup final this weekend. Tonight, City are in action against West Bromwich Albion and you can follow that game here.
7.36pmWe've got two teams that like to pass the ball this evening and Wigan will have to remain brave despite the importance of the fixture, while the Swans should be quite relaxed.
7.40pmWigan are unbeaten in their last two and may have found their usual late-season surge just in time this year, although even with a win tonight they could still be relegated.
7.42pmA win for the home side today would actually see four teams on 38 points, one on 39 points and two teams on 40 points, all with just two games of the season left. It really is the tightest finish at the bottom in recent years.
7.44pmJust a a couple of minutes away from kick off now, and there are several banners around the DW Stadium which suggest that the fans are in confident mood.
1 minWigan kick off and play the ball around their back four, before Caldwell hits it long towards Kone. The striker eventually fouls Williams as they wrestle for the ball and the Swans clear the ball.
3 minEspinoza plays a sloppy pass back towards Scharner, which is intercepted by Routledge who runs forward and fires at Robles' near post but the goalkeeper tips it wide.
5 minWigan have started a quick pace, trying to move the ball quickly between McArthur and McCarthy but Kone is not finding space in Swansea's defence easy to come by.
7 minMcManaman goes free on the right, and after beating Ben Davies once, beats him again, and again, until eventually running the ball out for a goal kick. Wigan regain possession though, finding McManaman on the wing again, this time he manages to switch the ball but Espinoza is forced back.
8 minKone comes in off the left and fires the ball towards goal but Vorm saves it comfortably and tries to release a Swansea counter attack. His pass goes long though and it's Wigan back on the ball.
10 minCaldwell looks for Kone with the long diagonal agains but Williams heads it away and Swansea maintain their first period of possession.
11 minThe away side are keeping the ball better now after Wigan's lightening start but are still finding it difficult to get out of their own half. McCarthy and McArthur are pressing high in midfield for Wigan.
14 minWigan break well with McManaman finding McCarthy, whose cross just evades Kone. Wigan retain the ball again but Espinoza's cross is also over hit.
17 minA fine tackle by Tiendalli on Maloney just outside the box allows Swansea to break through Routledge, Caldwell comes across and flicks the ball back to his goalkeeper, who picks the ball up!
18 minIndirect free-kick from eight yards out for Swansea...
19 minDe Guzman flicks it to the right where Williams is waiting to smash the ball high and wide to the relief of the crowd, as well as the ten Wigan players on the goal line.
21 minMaloney drops into central midfield and finds McManaman on the right who does well to win a throw-in after being hounded by two defenders. Swansea win the ball and break though, but just as De Guzman is about to pull the trigger, Boyce makes an important challenge.
23 minSwansea break on the right with Tiendalli but again they're forced back to their defence. Wigan are doing a very good job of getting back into position after an attack.
25 minMcCarthy is hauled down by De Guzman on the halfway line and picks himself up to find McManaman on the right, who after a clever piece of skill on Davies, hits his cross out for a goal kick.
26 minMcManaman involved again, slipping the ball to McCarthy, who plays Kone through on the right but the striker's powerful drive is blocked by Vorm with no one around to pounce on the rebound.
29 minMcArthur robs Rangel and plays in Espinoza down the left but again the cross evades everyone. Wigan get the throw in but are forced back to their goalkeeper.
32 minMcCarthy breaks on the left but is crowded out, only for Maloney to retain the ball and play it cross-field for McManaman, however Swansea win the ball and break.
34 minEspinoza plays it into t McArthur whose through ball for Watson is cut out by Britton, who sets Swansea on the break again with Routledge. The winger is crowded out though and Robles clears.
36 minEspinoza intercepts and heads the ball to Kone, who turns in the middle of the pitch before playing it wide to McCarthy, however his cross is deflected for a corner.
38 minSwansea clear but McManaman wins it back and gets to the byline, only for Williams to clear his cross. The resulting throw in sees Watson put the ball back into the box, but Espinoza fires over after arriving late at the back post.
40 minBritton turns away from McCarthy well in the middle and finds Davies on the left, whose cross is fired away by Caldwell and into space for Kone to run on to and find Maloney, who wins a free-kick on the edge of the box.
42 minMaloney takes the free-kick but it's straight at Vorm. Wigan win the ball from the goalkeeper's kick but Watson over hits his long pass to Espinoza on the left.
44 minHernandez gets into the game for the first time, linking well with De Guzman and Shechter as Swansea play the ball around the Wigan box. The home side eventually win it back and Shechter brings down Espinoza, and receives the game's first yellow card.
46+1 minGOAL! Wigan Athletic 1-0 Swansea City (Espinoza)
8.33pmWatson loops the ball to the back post with a deep cross towards Kone. The striker is beaten to the ball by Vorm but Espinoza is on hand to fire it in from the edge of the box right on the stroke of half-time.
8.35pmThat dramatic end to the half will certainly have made Roberto Martinez's team talk a little easier. Wigan have definitely been the better team during the first period, but lacked any cutting edge until the final seconds.
8.37pmEspinoza actually had a shaky start to the match, perhaps understandably in an unfamiliar position at left-back, but he grew into the game and became integral to Wigan's attack, finishing the half with an excellent volley to put his side ahead.
8.40pmUPDATE! In the other game this evening, Manchester City lead West Brom 1-0, thanks to a goal from Edin Dzeko.
8.43pmIn all honestly, Swansea have played like a team who have little left to play for. Neither team has really put the other under pressure, but Wigan have certainly dominated the possession and territory, and just about deserve the lead.
8.45 pmIt will be interesting to see what Wigan do now. Will the goal relax them, allowing the players to create more chances, or will they drop deep and try to hang on to the goal?
8.47 pmThe players are back out on the pitch for what is a massive 45 minutes in Wigan's season.
48 minTiendalli chips the ball to the back post where Hernandez brings it down and plays in Ben Davies but Wigan clear for a corner. Swansea play it short to Britton whose shot is blocked for another corner, but Wigan clear at the second time of asking.
49 minSwansea have definitely upped the tempo in the second half, with Hernandez coming in on off the left hand side to link the play.
50 minGOAL! Wigan Athletic 1-1 Swansea City (Rangel)
51 minRoutledge finds space on the left and is found by Hernandez before chipping it to the back post, where Rangel is on hand to volley across the goalkeeper, off the post and into the back of the net.
52 minGOAL! Wigan Athletic 2-1 Swansea City (McCarthy)
53 minWigan are back ahead immediately. Maloney plays it inside to Caldwell who finds a gap in the defence for McCarthy to run on to the ball and fire past the goalkeeper from just inside the box.
56 minAfter Swansea's bright start to the second half, we really have a game on our hands now. End-to-end, as Kone breaks on the left and finds McArthur free in the six-yard box, however the midfielder can not make enough contact on the ball and it goes wide.
58 minGOAL! Wigan Athletic 2-2 Swansea City (Shechter)
59 minAnother goal as Swansea equalise again! Caldwell gives the ball straight to Hernandez who plays it first time to Shechter. The striker steadies himself on the edge of the box and fires in off the post for his first Swansea goal.
61 minSome good play by McCarthy as he runs across the pitch and plays in Espinoza on the left, whose cross seems to strike Rangel on the arm. Bug appeal from Wigan but the referee waves it away.
63 minIt's a very open game now. McCarthy's effort is blocked before Swansea break on the right, only for Tiendalli to foul Espinoza on the edge of the Wigan box.
65 minSUBSTITUTION Wigan bring on Franco Di Santo in place of Callum McManaman as they look to take the lead for a third time.
67 minCHANCE! A great ball over the top from McCarthy releases Di Santo in the right but the substitute sees his cross deflected for a corner, which is swung in by Maloney and onto the head of Caldwell who is denied by a fantastic Vorm save!
69 minSUBSTITUTION Swansea's second goalscorer Itay Shechter is replaced by Nathan Dyer, whose pace could be useful on the counter attack.
71 minWigan are piling on the pressure now with the extra forward as Di Santo beats Ben Davies on the right before dribbling the ball out of play for a goal kick.
75 minGOAL! Wigan Athletic 2-3 Swansea City (Tiendalli)
76 minWigan fail to clear the ball, allowing Hernandez to pick it up and chip to the back post, where McArthur and Maloney again fail to clear, allowing Tiendalli to tip-toe in at the back post and fire past Robles.
78 minSUBSTITUTION Kemy Augustien replaces Pablo Hernandez for Swansea.
80 minWigan launch a free-kick into the box where Ben Davies heads the ball away before colliding with his goalkeeper. Both men are down, allowing for a break in play.
83 minIt looks like Swansea are going to have to make a substitution, with Vorm in pain here. Davies is up and seems to be okay.
85 minSUBSTITUTION Vorm goes off on a stretcher for Swansea and is replaced by Gerhard Tremmel. Wigan also make two changes, with Watson and Boyce off for Jordi Gomez and Ronnie Stam.
86 minBoth teams have made their three substitutions and it looks like Wigan are going for it in the last five minutes, plus a large chunk of stoppage time.
88 minSome good link up between Gomez and Kone sees the latter gain half a yard on the edge of the box before firing just wide.
90 minThere will be nine minutes of stoppage time for Wigan to find an equaliser, or even a winner. Neither side is able to keep possession at the moment, as Stam, who has just come on, has had to go off injured meaning Wigan will have to finish the game with ten men.
90+3 minEspinoza breaks on the left but fouls Rangel and relieves the pressure on Swansea. Wigan have resorted to playing it long which is easy for the away side to clear.
90+5 minMcArthur squeezes the ball left for Espinoza but his cross misses everyone. Wigan regain the ball but Maloney's through ball is too powerful for Kone and goes out for a goal-kick.
90+7 minKone turns Monk well and shoots from 30 yards but Tremmel blocks it easily before picking the ball up at the second attempt.
90+8 minDyer almost makes it 4-2, as Swansea break and Rangel finds him free in the box but Robles makes a good save.
90+9 minRobles leaves his goal for a free-kick and finds himself on the right-wing, crossing for Kone but his header is caught easily by Tremmel.
9.43pmWigan couldn't really muster many clear-cut chances after Swansea's third goal. The delay for Vorm's injury didn't help but after a dramatic second half, Newcastle United, Norwich City and Sunderland all breathe a sigh of relief.
9.44pmThe Latics have an FA Cup final to look forward to on Saturday, but avoiding relegation looks like a big ask now, as they sit three points away from safety with just two games remaining.
9.45pmThanks for joining me for an exciting game, and look out for the match analysis in the next half hour. Good evening.