After cutting the gap to 13 points last weekend in India, the Spaniard from Ducati satellite team Pramac also secured pole position for Sunday with a record lap at Motegi.
"I felt super strong for today's race," the smiling 25-year-old, nicknamed "Martinator", said after the sprint victory ahead of Brad Binder (KTM) in second and Bagnaia (Ducati) in third.
"I think we found a great base... Tomorrow I can be having more calm. With more laps, we need to manage the tyres. I feel really happy overall and yeah, let's go for another victory tomorrow," Martin said.
Defending world champion Bagnaia, 26, will be second on the grid on Sunday, when he could in theory be replaced at the top of the standings with just six more races to go after Japan.
"We have to be happy with what we had, so the position is ok. Jorge is in his best moment," said the Italian, now on 299 points compared with Martin's 291.
"But we have to remain calm and work for tomorrow. That will be another story," Bagnaia said.
South Africa's Binder is fourth in the overall table on 201 points behind Marco Bezzecchi on 252 and will be fourth when the riders line up on the grid on Sunday.
"My plan was to try get to the front straightaway, but Jorge had incredible pace. I couldn't believe the lap times we were doing," Binder said after the sprint.
"I am happy to be back on the podium. My boys did an amazing job. The bike worked better than it has worked all year. So let's try again tomorrow," he said.
In qualifying, Martin set a new lap record at a dry Motegi of one minute, 43.198 seconds, followed 0.171 seconds later by Bagnaia, and 0.353 seconds by 2022 Japanese GP winner Jack Miller on KTM.
"I feel strong. Making the lap record here in Motegi is always special. I really enjoy this track," said Martin.
His time surpassed a record set only on Friday by Binder, who came back in one minute, 43.489 seconds in practice, breaking the Motegi record set eight years ago by legend Jorge Lorenzo.
Bagnaia started third on the grid last week in India but the defending champion lost control of his Ducati just over halfway into the race and went for a somersault.
Martin won the sprint race in India and finished second behind Italy's Bezzecchi, who will start from the second row in Motegi, joined by Binder and Fabio Di Giannantonio.
The third row will feature Honda's Marc Marquez, making him the only rider on a Japanese machine in the front four rows.