Media playback is not supported on this device
Heneghan's early near-post header from Peter Winn's free-kick made it 1-0.
Southend equalised when Barry Corr's penalty found the bottom corner after John Rooney had fouled John White.
But winger Mahon won it on 51 minutes when he cut in off the right flank to fire home from the edge of the area.
Mahon's stunning left-foot shot earned Steve Burr's Chester a place in Monday night's televised second round draw for the first time in eight years.
It is a level of the competition the reformed club have not reached since a team including Everton boss Roberto Martinez and Stoke City striker Jonathan Walters reached the third round in January 2007.
But Chester, 14th in the Conference, were good value for their victory against the Shrimpers, who stand seventh in League Two.
Burr's men, in fact, could have won by more, but Southend keeper Daniel Bentley made a good first-half save to deny Craig Hobson's low 18-yard shot and Rooney, younger brother of Manchester United and England captain Wayne, had an effort cleared off the line by Gary Deegan.

Seven protesters were arrested overnight outside the immigration office where she was being held.
Guadalupe Garcia de Rayos, 36, a mother of two US-born children, crossed the southern border from Nogales, Arizona at 10:00 local time.
Protesters had tried to block vehicles transporting her, but were unable.
On Wednesday night, protesters, who feared her deportation under President Donald Trump's clampdown on immigration, blocked a van believed to be carrying Ms de Rayos.
It was one of several vehicles stopped from leaving the Immigration and Customs Enforcement (ICE) centre on Wednesday evening.
"Seeing my mom in that van... it was unexplainable. It was really heart-dropping," her daughter Jaqueline said during a press conference after the deportation was announced.
"No one should ever go through the pain of having their mom taken away from them, or the pain of packing her suitcase," the 14-year-old said through tears.
According to US media Ms de Rayos was arrested in 2008 during a raid on her workplace and was convicted of identity theft for possessing false papers.
But she was allowed to continue living in Arizona as long as she checked in with her local ICE office in Phoenix every six months, the report adds.
Read more on President Trump's immigration order:
Banned: An Iraqi family's immigration story
Is US heading for constitutional crisis?
Is Trump's immigration order legal?
It was during this check in on Wednesday that she was taken into custody, just days after Donald Trump signed an executive order broadening the regulations under which some people will be deported.
It stipulates that any undocumented immigrants convicted of a criminal offense get priority for deportation.
"We're living in a new era now, an era of war on immigrants," Ms de Rayos's lawyer, Ray A Ybarra Maldonado told the New York Times.
"Ms. Garcia, who has a prior felony conviction in Arizona for criminal impersonation, was the subject of a court-issued removal order that became final in July 2013," a spokesperson for US Immigration and Customs Enforcement told the BBC.
Despite appeals, judges "held she did not have a legal basis to remain in the US", Yasmeen Pitts O'Keefe said.
"ICE will continue to focus on identifying and removing individuals with felony convictions who have final orders of removal issued by the nation's immigration courts," she added in a written statement.
Dozens of activists gathered outside the centre in a bid to block vehicles from leaving, many of them chanting "justice".
Police said seven people had been arrested "without force" but that most of the protesters were "peaceful and exercising their rights properly".
Mr Trump's far-reaching executive orders have also suspended refugee resettlement and blocked individuals from seven majority-Muslim nations from entering the US.
The move sparked numerous protests in the US and across the world, as well as several legal challenges, although the American public appears to be evenly split on the issue.
The travel ban was eventually halted last week and a US court of appeals is due to issue its ruling on whether the executive order was justified or not in the coming days.
Ben Heneghan and Craig Mahon got the goals at Roots Hall as Conference side Chester produced the FA Cup first-round shock of the day by beating Phil Brown's Southend United.
[NEXT_CONCEPT]
A Mexican woman who had been living in the US since the age of 14 has been deported to Mexico, immigration officials have told the BBC.