The home side got off to a negative start when Fabio had to leave the pitch with a head injury and was replaced by George Friend.
Marten De Roon then had the ball in the back of the net for Boro but his effort was rightly ruled offside.
Arsenal had chances of their own and eventually took the lead on 42 minutes. Adam Clayton brought down Granit Xhaka just outside the box and Alexis Sanchez stepped up to curl a superb free-kick into the back of the net to make it 1-0.
However, Middlesbrough were level five minutes into the second half when Stewart Downing found Alvaro Negredo inside the box and the Spanish striker was able to stab the ball past Petr Cech to make it 1-1.
Downing then had a great chance of his own at the back post but he blazed his effort well over the bar.
Daniel Ayala had a close-range header saved by Cech before Arsenal found themselves back in front. Sanchez found Aaron Ramsey who laid the ball off to Ozil and the German international made no mistake from close-range to make it 2-1.
Ben Gibson could've levelled late on for Boro but his shot from well inside the box lacked conviction and Cech was able to make a simple save.
The win for Arsene Wenger's side puts them up to sixth while Steve Agnew's Boro remain six points from safety.