Baines (left) and N'Zogbia (centre) scored the game's two goals
Leighton Baines's penalty earned Everton a draw and kept his former side Wigan in the relegation dogfight after a lively game at the DW Stadium.
Baines netted from the spot after Hugo Rodallega's clear handball after Wigan had looked on course to win thanks to Charles N'Zogbia's first-half goal.
After scoring N'Zogbia gave away a penalty when he fouled Leon Osman, but Mikel Arteta's spot-kick was saved.
That looked to be enough to earn Wigan a rare home win before Baines struck.
Wigan came into the game facing a battle to stay in the top flight and burdened by a worrying set of statistics, having the second worst home record in the division and the joint lowest total of goals scored.
So they showed admirable positivity as they took the game to the visitors from the outset, and Rodallega should have done better than to shoot off target when Ben Watson's long pass split the Everton defence.
After Wigan's early flurry, Everton began to impose themselves more on the match, and they would have been frustrated not to have even tested home keeper Ali Al Habsi when a sustained period of Everton pressure ended with Emerson Boyce's tackle denying Victor Anichebe the chance to shoot.
Martinez proud of Wigan players
When the first goal came, it was something of a surprise that it was for Wigan.
James McCarthy chipped the ball into the path of N'Zogbia from the edge of the box, but the chance seemed to have gone as he was forced away from goal by keeper Tim Howard, and even lost his footing and fell to the ground.
However, with the American backing off and his defence thinking the attack had broken down, N'Zogbia looked up and curled in a shot from the right-hand side of the box into the far corner.
Everton responded well to going a goal behind, showing more creativity and potency up front, but Wigan responded by packing the defence with bodies as a rudimentary but effective way of keeping them out.
And it was a makeshift defender who caused the next moment of drama in the match, as striker N'Zogbia gave away a penalty by hauling down the threatening Osman on the edge of box following Baines's short corner.
Up stepped Arteta. His penalty was at a good height to the keeper's left, but Al Habsi threw himself at it and made a fine one-handed save, to the delight of the home fans.
This incident raised both the tempo and the temperature of the match, which became increasingly fractious.
Everton assistant boss praises Wigan's spirit
N'Zogbia picked up a knock in a challenge with Baines before the break and failed to run it off after the restart, which led to the introduction of Victor Moses, and this only increased Wigan's threat.
Twice in a matter of minutes the former Crystal Palace player came within inches of extending their lead.
Firstly, Phil Jagielka's clearance of Emerson Boyce's cross only went as far as Moses, whose shot drew a two-handed save from Howard, and shortly afterwards Boyce was again the provider as Moses forced Howard to push another shot over the bar.
Despite Wigan having the most potent individual on the pitch, Everton were not cowed and they continued to throw everything into attack.
Jagielka connected with Baines's crossfield free-kick to draw a save out of Al Habsi, and from the resulting corner, Rodallega clearly handled the ball.
With Arteta no longer on the pitch, Baines was handed the responsibility, and he thumped an unstoppable shot high into the top corner.
Wigan went all out on attack in the dying minutes, but a combination of stout defending and wayward finishing denied them a late winner.
Wigan manager Roberto Martinez:
"The result is frustrating but I couldn't be prouder of the performance. We played under massive expectations against a side who'd had a good run, but we created better chances and were the better side so there's not much you can do after that.
"With the amount of chances we created we deserved the three points. The important test we've got is to play in that manner carry on being strong and brave and not allow the table to frustrate us.
"We're still a young group we're exciting and if we carry on like this we'll get enough points."
Everton assistant manager Steve Round:
"Missing the first penalty put us back a bit but I don't think Leighton would have missed the second one. Neither of them (Mikel Arteta or Leighton Baines) is the designated penalty taker, it depends on the day - they both practice them so we'll continue with those two.
"We showed terrific resilience to come back into the game and we thought we'd go on and win it but Wigan showed great resolve and fighting spirt.
"Wigan had a good attitude, we found it a tough game. Tim (Howard)'s had a terrific season and he was outstanding again today, at the moment he could be one of the best keepers in the Premier League, if not the best."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.