France striker Olivier Giroud gave a dominant Arsenal an early lead, but his side was pegged back by Craig Gardner's penalty for Sunderland in the 48th minute.
Ramsey restored the visitors' lead in the 67th with a spectacular shot from just inside the area and then sealed the points in the 76th.
Despite the scoreline, though, Arsenal's third consecutive league victory was not a comfortable one. Sunderland put up plenty of resistance and its players were left to rue two second-half goals that were disallowed for Steven Fletcher and American forward Jozy Altidore.
Mesut Ozil, Arsenal's club record signing at 50 million euros ($67 million), made his debut in midfield and needed less than 11 minutes to provide his first assist — setting up Giroud's opener on the break.
Ozil collected a long ball forward on the left side and threaded an inviting pass into the box for Giroud to rifle into the bottom corner.
It was only the start of a promising debut for the Germany international.
Ozil followed up by putting Theo Walcott clean through just minutes later — only for keeper Keiren Westwood to block his angled shot. He then tried his luck with a curling free kick in the 26th which the keeper comfortably smothered.
The chances continue to fall for the visitors, but Walcott could only send a free header from Giroud's cross well wide of the target and saw another effort blocked.
Arsenal paid the price for those missed chances just three minutes after the re-start when defender Laurent Koscielny felled Adam Johnson in the area and Gardner made no mistake with the spot kick.
Fletcher then bundled a cross by Johnson into the Arsenal net minutes later, only to have it ruled offside, and Gardner rattled Wojciech Szczesny's post with a free kick.
Just as Arsenal was living dangerously, Ramsey restored his side's lead by meeting Carl Jenkinson's cross from the right with a superb first-time shot.
Sunderland shrugged off the setback and again had the ball in Arsenal's net, with Altidore's effort being ruled out for an earlier foul by Arsenal defender Bacary Sagna on the American forward.
Ramsey made sure of the points for Arsenal after a clever passing move, put through by Giroud for a crisp finish.