Just one point separated the two sides ahead of a clash that looked like it would only be remembered for red card controversy in the first half.
Mateo Kovacic avoided a red card despite his two reckless challenges on Martin Odegaard and Declan Rice.
Referee Michael Oliver chose to show him a yellow card for the first tackle and let him go unpunished for the second.
The incidents, along with David Raya's shaky moments, were the only real talking points of the game as both sides lacked a killer threat.
However, this was until Arsenal struck at the death to win all three points and cement themselves as Premier League title challengers.
READ MORE on arsenal
Oliver 'bottled it' as Kovacic avoids red card for challenges on Arsenal duo
Samir Nasri left 'shaken' after being 'verbally abused' by Arsenal fans
Martinelli, who started on the bench having returned from injury, was brought on at half-time for the Gunners, replacing Leandro Trossard.
His shot from Kai Havertz's lay-off hit City defender Nathan Ake and flew into the back of the net.
It sent the home crowd at the Emirates Stadium into raptures as they called time on a run of 12 Premier League matches ending in defeat against City.
Victory has sent them go level on points with north London rivals Tottenham, with the latter only top due to more goals scored.
Most read in Football
Arsenal 1-0 Man City LIVE: Gunners claim famous win as Martinelli fires home late on
Samir Nasri left 'shaken' after being 'verbally abused' by Arsenal fans
Bukayo Saka OUT of Arsenal squad for huge Man City clash
Why Pascal Gross was not sent off for giving away Liverpool penalty
City sit just one point behind both sides but have now lost twice this season, and the latest of their back-to-back league defeats could prove crucial.
Arsenal remain unbeaten in the league and bounced back from their Champions League defeat against Lens in style.
With just eight games played there is still a long way to go this season, but it's clear that the Gunners are setting their sights on the title once again.