What a difference a week makes. Arsenal rediscovered their verve to give themselves a tantalising chance of reaching the Europa League final in Baku at the end of May. Attack has to be their best form of defence and their two shining lights up front delivered to give them a 3-1 advantage to take to the Mestalla next week.

What a difference a late goal makes, too. Going into stoppage time they were entitled to feel fretful about a 2-1 lead, a scoreline that felt fraught with danger going into an away leg. One last push delivered the extra helping they require to travel to Spain with more confidence.

Arsenal’s mission for this season was always about getting back into the Champions League by any means possible and, after a dismal week spent stumbling through three Premier League defeats with no redeeming features, Europe arrived with an extra frisson of pressure and possibility.

If recent tumbles taught Arsenal anything it is that they may as well throw caution to the attacking winds because, well, they certainly cannot rely on trying to be cautious. This game offered evidence that defensive shakiness lingered, but also that their main attacking weapons can do damage. Alexandre Lacazette scored twice and Pierre-Emerick Aubameyang’s late addition changed the complexion of the tie enough for Valencia’s coach Marcelino to lament how it was “a shame” his team could not hang on to a more promising position. “They have two very good strikers, I don’t know how many millions of euros they cost,” he said. “If you make even the slightest mistake at this level players like that can take advantage of that.”

Unai Emery has spent the majority of this Europa League knockout stage glued to his view that any situation feels like 50/50 and this is no different. His wariness is understandable, though, considering how Valencia had enough moments of their own to worry Arsenal’s defence.

They had already caused one major scare before they plundered their away goal in the 11th minute. Daniel Parejo’s driven corner caused aerial woe. First Sokratis Papastathopoulos was beaten by Rodrigo, and even though Mouctar Diakhaby was outnumbered as the ball came across, no prizes for guessing who showed the most single minded determination to meet the ball. Diakhaby gleefully nodded in.

Mouctar Diakhaby capitalises on some woeful defending to give Arsenal an early jolt. Photograph: Tom Jenkins/The Guardian

Aubameyang admitted it was not easy for Arsenal to find their mojo. “We started a bit nervous because we lost the last three games, I think that’s normal. We are human, but after that we had a good reaction,” he said.

Indeed they did, finding a response when their two front men combined suddenly with speed and accuracy. Lacazette, inside his own half, spun away and drove the ball forwards for his partner. Aubameyang drew the attention of Neto in the Valencia goal, found a yard of space to look up and spied Lacazette hurtling into the box. The finish was crisp into an empty net.

Lacazette was fired up, and six minutes later headed his team in front from Granit Xhaka’s lofted pass. Neto scrambled to reach it but could not get a strong enough grip to prevent the ball from crossing the line.

Valencia threatened again after the break but by now Arsenal’s rearguard began to show more determination. Laurent Koscielny, in particular, was heroic at times and Emery is hopeful he will shake off his fatigue for the second leg.

Alexandre Lacazette scores his and Arsenal’s second with a bit of help from Neto and goal-line technology. Photograph: Joe Toth/BPI/REX/Shutterstock

It was a delicate balancing act for Arsenal, endeavouring to keep a semblance of defensive calmness while also probing for the additional goals needed to give them more of a leg up for the second leg in Spain. There was recklessness in the air, as if anything might happen.

Lacazette’s eventful evening managed to be at once a glass-half-full and glass-half-empty experience. His two goals and part in the third were vital but he must also be wondering about the ones that got away. He could have scored four. The coup de grace instead fell to Aubameyang, who appeared at the far post to angle home Sead Kolasinac’s driven cross.

Emery has asked for cool heads from his team next Thursday. “I still believe the tie is in the balance,” he said. “It will be a very tough atmosphere. We must be calm in the second leg.”

This time last year Arsenal succumbed to a late goal in the home leg of their Europa League semi-final, as Atlético Madrid’s Antoine Griezmann struck a sucker punch from which they could not recover, especially against such experienced and controlled opponents. “We stopped in the semi-finals last year but we’ve learned from last year’s errors and hopefully this year we won’t do the same,” said Aubameyang. “We will give everything to qualify for the Champions League.” All to play for next week in Valencia.