two late matheus goals kept the hosts' chances alive and left arsène wenger's side needing a win on matchday 6 to ensure qualification.
sc braga kept their hopes of qualifying for the uefa champions league knockout stage alive in their debut season in the competition with a late victory against arsenal fc.
matheus struck twice in the last ten minutes to send arsène wenger's side into their final match at home against fk partizan needing a win to make sure of an 11th successive qualification for the last 16. domingos paciência's men, meanwhile, will travel to the donbass arena to meet fc shakhtar donetsk still holding a glimmer of hope.
arsenal started strongly, eager to put recent domestic jitters behind them, with theo walcott and jack wilshere both making runs behind the defence to produce excellent crosses in the opening five minutes. yet the home side were in no mood to roll over, desperate to improve on their 6-0 defeat in london on their uefa champions league debut.
in the eighth minute moisés found space from luis aguiar's dead-ball delivery, but could not keep his header down. a far more cagey battle was developing than on matchday 1. arsenal dominated possession but offered little in the way of penetration, though felipe was forced to tip over cesc fàbregas's curling free-kick.
the action heated up in the 34th minute. first, felipe sped out of his goal to bravely smother at the feet of walcott, then braga broke and lima was a whisker from opening the scoring, bending a shot just wide from outside the penalty area.
still the gunners threatened, and the dangerous walcott dragged a cross-shot wide as half-time approached. the england international again led his side forward as the second period began, hitting a free-kick that brushed the roof of the net.
with shakhtar leading against partizan, braga needed to win to stay in contention and began to throw caution to the wind. arsenal were finding space and only moisés' lunging interception prevented nicklas bendtner giving the away side a 71st-minute lead.
however, there was a twist in the tale, as matheus sped onto elton's 83rd-minute pass. he pulled the ball onto his left foot and coolly placed it past lukasz fabiański to send the home fans wild. braga were holding on, but matheus then added a second in added time, racing clear from halfway and smashing in a splendid shot off the crossbar after holding off a posse of three arsenal defenders.