Fernandez broke the beam with a time of 2:08.979s with the chequered flag out, beating Gardner's 2:09.299s by a full three tenths of a second.
Joining the two championship contenders on the front row at the Circuit of The Americas will be Federal Oil Gresini's Fabio Di Giannantonio, ahead of Marco Bezzecchi (Sky VR46), Cameron Beaubier (American Racing), and Augusto Fernandez (Elf Marc VDS).
Di Giannantonio set the early pace with a 2:09.457s on his first flyer before Gardner went to the top with a 2:09.197s next time around.
The latter lap would not count, presumably due to the presence of yellow flags in Sector 4, but #87 stayed on top when it was finally chalked off given that he had followed it up with the 2:09.299s on his third flyer.
Lap cancellations did the opposite for Raul Fernandez, who rose from seventh on the timing screen to third even as he sat in the pits at the end of his first run.
However, he earned pole on merit with a charging final lap, as Gardner could only clock a 2:09.656s while he circulated a couple of seconds back on the road from his KTM Ajo team-mate.
Di Giannantonio found no improvement on his initial 2:09.457s, while Bezzecchi's personal-best 2:09.557s meant that it was only the two other front row starters within half a second of Raul Fernandez.
Notables beyond the first two rows included Ai Ogura (Idemitsu Honda Team Asia) in eighth at 0.824s off the pace, and Aron Canet (Inde Aspar) way back in 14th at 1.293s from pole.
Sam Lowes (Elf Marc VDS) fared even worse, qualifying 16th with an unrepresentative 2:15.903s after crashing at Turn 3 with just under five minutes remaining in the 15-minute Qualifying 2 session.
Jorge Navarro (MB Conveyors Speed Up) had an early spill on his way to 17th and a subsequent 2:10.125s would have only been good enough for 14th had it counted.
Gardner's championship lead over Raul Fernandez is 34 points with four races remaining, the next of those being an 18-lapper around the Circuit of The Americas from Monday morning at 04:20 AEDT.