Yamaha's Lorenzo had been quickest in practice and held a provisional pole after two qualifying sessions thanks to a best time of one minute and 47.226 seconds.
But Repsol Honda rider Pedrosa, who had finished Q2 in a lowly seventh place, improved significantly on his final lap to beat Lorenzo to the line by 0.069secs with a time of one minute and 47.157 seconds.
The world championship leader told BBC Sport: "I had almost no time left and I was only sixth fastest.
"I had to really push hard and it worked for me. However, I hope we can improve the bike a bit for tomorrow so we can up the pace."
His fellow Spaniard Lorenzo, who won at Mugello last year, will be desperate to make amends for Saturday's slip-up by denying his countryman a third straight Grand Prix victory.
"When I saw my lap time I expected to be in pole but it was an incredible lap by Dani," said Lorenzo.
"We have good pace for fighting with him on Sunday."
Andrea Dovizioso will also start from the front after earning Ducati third place on tomorrow's grid.
The Italian registered a time of one minute 47.628 seconds despite hurting his neck during a crash in practice on Friday.
His compatriot Valentino Rossi, however, slumped into seventh on his Yamaha amid the clutch of late improvements.
Cal Crutchlow, riding with a broken leg and hampered by a crash eight minutes from the end of Q2, beat Stefan Bradl and Marc Marquez (Repsol Honda) to fourth place on his spare Monster Yamaha Tech 3.
Marquez had briefly appeared in a provisional second on the grid but slipped back to sixth, just behind LCR Honda's Bradl.
Two factory Ducati bikes made the top 10 thanks to Nicky Hayden and Michele Pirro, who were split into eighth and 10th place respectively by Honda Gressini's Alvaro Bautista.