The Yamaha rider posted a time of one minute 49.404 seconds to usurp title rival Dani Pedrosa (Repsol Honda) in the final moments of the qualifying session.
Pedrosa recovered from an earlier crash to sit atop the timesheets as the clock ticked down, but he was unable to respond to the late charge of Lorenzo, who pipped his fellow Spaniard by just 0.088secs.
"I am happy that the bike got better each time we took it out," Lorenzo said.
"We went for it on slick tires at the end and managed to get the first spot."
With five races remaining, Lorenzo leads the way in the standings by 38 points from Pedrosa, who is bidding to bounce back from the disappointment of crashing out in Misano a fortnight ago.
Conditions at Aragon this week have been very similar Misano, with the first three practice sessions held in the wet before the weather cleared for qualifying.
The change in conditions appeared to catch out Pedrosa when he crashed just five minutes into the hour-long qualifying session.
Pedrosa took a heavy tumble when he lost the front of his bike as he braked for turn 14, and returned to the pits for his spare bike and leathers before punching in a solid time that puts him on Lorenzo's shoulder for the start of Sunday's race.
"It's a very good result for us after all the issues we had," said Pedrosa.
"I'm really happy to be on the front row and so close to the pole position.
"We have a good position for the start, I just hope everything goes smoothly and we can have a great race tomorrow [Sunday] in front of the home Spanish crowd."
Britain's Cal Crutchlow topped the timesheets for some of the session but in the end the Tech 3 Yamaha rider had to settle for third place, while Lorenzo's factory Yamaha team-mate Ben Spies took fourth.
Stefan Bradl will line up fifth on his Honda ahead of Crutchlow's team-mate Andrea Dovizioso, while Pedrosa's stand-in team-mate Jonathan Rea was seventh, the Briton impressing on his second outing for the factory Honda team as understudy to the injured Casey Stoner.
Ducati pair Valentino Rossi and Nicky Hayden were next up, with the customer Ducati of Hector Barbera completing the top 10.