Yamamoto, who hadn't qualified higher than 10th all season and only scraped through his Q1 group in sixth place, pulled out a lap of 1m30.423s in the Q2 pole shootout to beat Sacha Fenestraz to pole position by 0.316 seconds.
It marks Yamamoto's first pole since the 2020 Suzuka round, and the first for Nakajima Racing since IndyCar champion Alex Palou's pole at the same track in 2019.
"I'm happy, especially because I've struggled for a year and-a-half, and I'm so grateful to [Satoru] Nakajima-san and all the staff in the team," said Yamamoto.
"Honestly, I didn't think I had the speed for pole. Yesterday [teammate Toshiki] Oyu was fast [in practice], but looking at his data and we were able to combine that with the best aspects of our set-up. It was on the limit to get through Q1, and it was a reminder of just how hard Super Formula is."
- Watch all Super Formula races live on Motorsport.tv (available worldwide except Japan). Click here for more information.
Kondo Racing driver Fenestraz's front-row slot, giving him two crucial bonus points, also came as a surprise after an engine issue in Friday's sole practice session robbed him of the chance to do a qualifying simulation.
Points leader Tomoki Nojiri (Mugen) was left with no bonus points for the first time since the Fuji season opener in fourth, one place behind Yamamoto's Nakajima teammate Toshiki Oyu.
But Nojiri's 29-point championship lead remains intact with nearest rival Ryo Hirakawa qualifying down in 13th.
Tadasuke Makino was fifth for Dandelion Racing, followed by Sho Tsuboi (Inging), Kenta Yamashita (Kondo) and Nobuharu Matsushita (B-Max Racing).
Completing the top 10 were Ritomo Miyata (TOM'S) and Yuhi Sekiguchi in the best of the Impul cars.
Like Mugen teammate Nojiri, Ukyo Sasahara had topped his Q1 group, but in Q2 he failed to start his final attack lap in time before the chequered flag fell, condemning him to 12th on the grid.
Hirakawa's elimination was the big surprise of Q1 - the Impul driver was among the first drivers in Group A to set a representative lap, but was progressively shuffled down the order as his rivals set their fast times.
He ultimately missed out on a spot in Q2 by a mere 0.013s, leaving him 13th on the grid for Saturday's race.
Red Bull junior Ren Sato, under pressure this weekend following Helmut Marko's comments about his performances so far this season, was likewise knocked out in Q1A and will start 15th.
Giuliano Alesi (TOM'S) was among those to drop out in Group B and will take the start from 18th place, his worst grid slot of the year.
Motegi Super Formula (Rd. 7) - Q2 results:
1. Naoki Yamamoto(TCS NAKAJIMA RACING)1'30.423
2. Sacha Fenestraz(KONDO RACING)1'30.739
3. Toshiki Oyu(TCS NAKAJIMA RACING)1'30.801
4. Tomoki Nojiri(TEAM MUGEN)1'30.813
5. Tadasuke Makino(DOCOMO TEAM DANDELION RACING)1'30.908
6. Sho Tsuboi(P.MU/CERUMO・INGING)1'30.915
7. Kenta Yamashita(KONDO RACING)1'30.962
8. Nobuharu Matsushita(B-Max Racing Team)1'31.033
9. Ritomo Miyata(Kuo VANTELIN TEAM TOM’S)1'31.300
10. Yuhi Sekiguchi(carenex TEAM IMPUL)1'31.459
11. Hiroki Otsu(DOCOMO TEAM DANDELION RACING)1'31.679
12. Ukyo Sasahara(TEAM MUGEN)2'04.157