Mexican Perez, in only his second race for Red Bull, lines up alongside Mercedes’ seven-time world champion for what will be his first front row start.
Verstappen, fastest in final practice at the Italian circuit and chasing a hat-trick of poles, had to settle for third with Ferrari’s Charles Leclerc a strong fourth on a home track for the revived Italian team.
Hamilton did enough with his first flying lap of one minute 14.411 seconds, but Perez came close at the end with an effort only 0.035 slower.
“I definitely didn’t expect us to be ahead of two Red Bulls,” said Hamilton, who won the season-opener in Bahrain last month after Verstappen started on pole.
“I think they have been so quick this weekend, there were times when they were six-tenths ahead.
“I came around the last corner and heard I’d got the pole and I was super grateful,” added the 36-year-old, who has now taken poles on a record 30 different circuits.
Perez, who boasts more than a decade of experience in Formula One, was brought in to put more pressure on Mercedes than Verstappen’s recent team mates had managed and duly delivered.
The Mexican still felt he could have done better.
“I’ve been improving, P2, but I should’ve been on pole and I did a mistake on the final corner,” said Perez, a first time winner with Racing Point (now Aston Martin) in Bahrain last year.
It was the first time Verstappen had been outqualified by a team mate in regular conditions since Australian Daniel Ricciardo was alongside at Red Bull in 2018.
“You can’t be good every time, so we’ll see what went wrong,” said the Dutch driver. “It’s still P3, which is a good starting position.”
AlphaTauri’s Pierre Gasly qualified fifth with Ricciardo sixth for McLaren and team mate Lando Norris seventh.
Norris would have been on the front row had his fastest lap not been deleted for exceeding track limits.
Hamilton’s team mate Valtteri Bottas, on pole at Imola last November and fastest on Friday, qualified a disappointing eighth — leaving Hamilton exposed in Sunday’s race with the Red Bulls also on different tyre strategies.
Hamilton will start on medium tyres, with Perez on softs and Verstappen also on mediums.
“Anything can happen, we are on a different strategy to Lewis and Max,” said Perez. “It is going to be interesting, see what we can do.”
Spaniard Carlos Sainz, in his first race in Italy with Ferrari, failed to make it through to the final shootout and starts 11th.
Both Williams drivers reached the second phase for the first time since last July, with George Russell still sounding disappointed with 12th despite being ahead of former champions Sebastian Vettel and Fernando Alonso.
Four-time champion Vettel will line up 13th for Aston Martin and Alonso, a winner at Imola with Renault in 2005 on his way to the first of two titles, 15th for Alpine.
Japanese rookie Yuki Tsunoda was the big casualty of the first session, losing control at the Variante Alta and smashing his AlphaTauri backwards into the tyre wall.
“For me that was a huge mistake and I feel really sorry for the team,” he said, with the session red-flagged as the badly damaged car was removed from the track.
Qualifying was brought forward by an hour as a mark of respect to ensure there was no overlap with the funeral in Windsor of Britain’s Prince Philip, who died last week at the age of 99.
The teams, most of whom are based in England, held a minute’s silence before qualifying.