Bournemouth had taken the lead after just 9.11 seconds through Philip Billing, and went 2-0 up via a Marco Senesi header.
However Arsenal pulled level with goals by Thomas Partey and Ben White, before Nelson struck.
The winger, making his first appearance since 12 November, slammed in from 25 yards in the seventh minute of stoppage time.
Arsenal’s Premier League lead is restored to five points, after they had seemed certain to cede ground to Manchester City, winners over Newcastle in the early kick-off.
Bournemouth, meanwhile, remain in the relegation zone after threatening a major upset – and beginning at top speed.
Billing’s goal was the second-quickest in Premier League history – only Shane Long, who scored for Southampton after 7.69 seconds at Watford in April 2019, has netted faster.
How did you rate Arsenal’s performance? Have your say here.
What did you make of Bournemouth’s display? Send us your views here.
Nelson colossal as Arsenal snatch victory
Nelson had played just 64 minutes of Premier League football this season – having struggled with thigh problems – before being thrown on as a second-half substitute by Mikel Arteta here.
Yet the homegrown talent was the unexpected hero, collecting a half-cleared corner outside the area and bending a superb strike beyond Bournemouth keeper Neto.
The outpouring of emotion that followed was immense; the Arsenal bench cleared as virtually every player and member of staff rushed to celebrate with the match-winner.
Nelson had earlier, with practically his first Premier League touch of 2023, provided the assist for White to equalise with his first Arsenal goal.
White, brought on as a half-time substitute after Takehiro Tomiyasu endured a torrid 45 minutes, struck Nelson’s deep cross first time and his shot was palmed away from behind the line by Neto, with referee Christopher Kavanagh giving it via goalline technology.
What is remarkable is that Nelson, had everything gone to plan for Arsenal, would have been very unlikely to reach the pitch. He replaced Emile Smith Rowe, himself a sub for Leandro Trossard, who suffered a first half injury.
However it is with unexpected twists, remarkable moments and incredible goals that titles are often won.
Billing’s rocket start in vain for Cherries
Arteta would have wanted his side to make a fast start in order to restore their advantage over City. He got the exact opposite.
From the kick-off, Joe Rothwell fed a pass wide to Dango Ouattara, whose low ball across the box was dummied by Dominic Solanke and missed by Gabriel, who allowed it beneath his studs. Billing escaped William Saliba’s lax marking, and finished under Aaron Ramsdale.
With the form which earned Gary O’Neil the permanent manager’s seat a distant memory, and now just one win in their last 12 games, a win – or even a point – would have provided a real boost for Bournemouth in their bid to escape relegation.
However, like Arsenal, their defence is their weakness. Nelson’s strike was the 35th goal they have conceded in away Premier League matches this season – a division high.
The greater damage however could be psychological, with players, fans and O’Neil all left in despair by the late winner.
For a long time, Bournemouth defended their very early lead with stubbornness and co-ordination, marshalled well by goalkeeper-captain Neto, who made a terrific double save from Martin Odegaard and Bukayo Saka just minutes after Billing’s opener.
Bournemouth were happy to attack on the break, and should have gone two ahead before half-time, Ramsdale making a superb spreading save to deny Dango Ouattara as the visitors countered from an Arsenal corner.
However they dropped deeper as the game progressed – until the decisive blow in the final seconds.
Partey gets the late party started
While Arsenal continue to lead the pack in their pursuit of a first Premier League title in 19 years, they also have clear defensive frailties – they now have just three clean sheets in their past 18 home league games.
Arteta may have thought the return of Partey to central midfield, his first start in three weeks, would have given a defensive boost. But the Ghanaian, playing in front of his national team manager Chris Hughton, was at fault for the Bournemouth second.
Partey lost his man Senesi from a 57th-minute corner, allowing the Italian defender a free near-post header past Ramsdale.
He started to make amends with Arsenal’s first goal, volleying home from six yards – before Nelson took over.