The Gunners went into the game looking to end the season on a high having missed out on a Champions League place via a top-four Premier League finish and claim a 13th FA Cup win, while also giving boss Arsene Wenger a record seventh success in what could be his final game in charge.
Sanchez put them ahead early on and they looked certain to go on and win comfortably when Chelsea winger Victor Moses was sent off for two bookable offences with just over 20 minutes remaining.
Diego Costa then levelled for the Premier League champions to keep alive their hopes of a domestic ‘Double’, but Ramsey grabbed a winner for Arsenal 11 minutes from time.
Arsenal were handed a dream start in the fourth minute when N’Golo Kante’s attempt to clear the ball bounced off the chest of Sanchez who continued his run into the area before rifling a low right-foot strike into the far corner past Thibaut Courtois.
The flag was initially raised on the far side for a possible offside against Ramsey who was stood alongside Sanchez.
However, referee Anthony Taylor correctly judged that the Gunners’ midfielder was not interfering and overturned the assistant’s decision by awarding the goal.
Chelsea attempted a quick response but Costa sent his header from a right-wing Eden Hazard free-kick over the bar.
Sanchez looked for a second on 14 minutes but his fierce 25-yard effort dipped just over the Chelsea goal.
The Blues raced up the other end and Nacho Monreal was on hand to put in a vital block to prevent Costa firing into the net from the middle of the penalty area.
Mesut Ozil had a great chance to make it 2-0 on 16 minutes when he was played in by Sanchez down the right of the area, but after a poor first touch, his scuffed effort just got the better of Courtois only for Gary Cahill to then clear off the line with Danny Welbeck breathing down his neck.
Arsenal continued to press for a second and on 19 minutes Welbeck’s flick header from an Ozil right-wing corner bounced off the far post and then rebounded up off Ramsey’s chest and back off the upright before dropping out of play.
Costa was denied in the 28th minute when he managed to hold off Rob Holding in the area, but the Gunners’ custodian David Ospina raced off his line to make a good save and suffered an accidental kick to the face for his troubles.
Cahill then rescued Chelsea again on the half-hour when Welbeck got in down the right and worked the ball past Courtois only for the England international to make another goalline clearance ahead of Sanchez.
Two minutes later a free-kick was cleared as far as Granit Xhaka just outside the Chelsea area and his first-time volley was parried behind by Courtois.
On 39 minutes Pedro had a half-chance for Chelsea when he created an opening down the right, but fired over the bar with an angled strike.
Chelsea came out for the second half with more purpose and Kante tested Ospina on 49 minutes with a drive from the edge of the area, which took a slight deflection off Xhaka, but the keeper saved fairly comfortably.
Ospina produced a better stop on 51 minutes when Moses surged into the area down the right and his angled drive was parried, before the colossal Per Mertesacker cleared the loose ball to safety.
Moses then teed up Pedro on the edge of the Arsenal area on 59 minutes but he flashed his effort wide.
Courtois kept Chelsea in the final with a fine low save to his right, preventing Hector Bellerin’s effort finding the bottom corner after he was set up by Welbeck from the left.
Chelsea were reduced to ten men in the 68th minute when Moses dived in the area under pressure from Alex Oxlade-Chamberlain and was given a red card following on from his second booking for simulation.
The game burst into life with two goals in the space of three minutes.
The ten men of Chelsea got on level terms on 76 minutes when Costa chest down a Willian ball into the area and held off Holding before hitting a scuffed shot which beat Ospina at the back post.
However, Arsenal went back in front on 79 minutes when substitute Olivier Giroud’s ball from the left found the unmarked Ramsey in the middle and he stooped to head in from close range.
Bellerin almost sealed the game with what would have been a fantastic solo goal on 84 minutes as he motored past David Luiz and into the area but hit a low right-foot effort just wide of the far post.
Ospina pulled off a brilliant save to deny Costa four minutes from time as the Spain international barged his way into the area and looked certain to score but the Colombian was equal to the task.
Ozil should have wrapped things up late on when he worked an opening on the right side of the area but hit the post with just Courtois to beat.