Following Pedrosa and Stoner was Andrea Dovizioso after the second free practice while defending champion Jorge Lorenzo was fifth.
Stoner is on the brink of becoming double world champion, holding a 44-point lead over Lorenzo, and is keen to wrap up the title as soon as possible.
The Australian was quickest in first practice, setting the fastest lap of the session with one minute 47.289 seconds ahead of team-mate Dovizioso.
Nicky Hayden was third, despite a run-off, while Pedrosa was in fourth - a little more than half a second off Stoner's time - one place ahead of Lorenzo.
The class then headed out for the second free practice for a session in which six riders were run off the track.
Pedrosa took over top spot with 21 minutes to go and set a new fast lap of 1min 46.790secs ahead of team-mate Stoner by a margin of 0.054s.
Dovizioso followed with a 1:46.952, with San Carlo Honda Gresini Team's Marco Simoncelli occupying fourth spot after leading in the early part of the session.
Lorenzo (Yamaha Factory Racing) was fifth in the combined time while Nicky Hayden (Ducati Team), third in FP1, ended the day in sixth.
Pedrosa said: "We did a good job today; in the morning we took a good direction and this allowed us to improve a lot in the afternoon, by a second, and this is very important.
"Tomorrow we have to focus on the set up of the bike; maybe the weather will change a little bit, so we have to be aware of the conditions and try to be fast anytime.
"In case it does rain tomorrow and we cannot practice anymore in dry conditions, we already have a good set up for the dry.
"Everybody here at the Motegi circuit has done a very good job with the new surface, the grip is much better than before and this is one of the reasons why the lap times have improved quite a lot already from last year."
Stoner was positive after identifying why he enjoyed less success in the second session, saying: "The bike felt pretty good this morning and then this afternoon we started the session on pretty much the same setting that we ended on this morning, it felt ok but we felt we could improve.
"Unfortunately we went in slightly the wrong direction and couldn't get the bike to turn or hook up on the last two exits and then we didn't really have enough time to come in and make a change. We know what direction we want to go in now and hopefully tomorrow we can make the small improvements."
Hiroshi Aoyama (San Carlo Honda Gresini) stepped up his pace by a full second, putting the Japanese rider seventh ahead of Ducati Team's Valentino Rossi in eighth.
Yamaha Factory Racing's Ben Spies retired from the session after five laps with exhaustion after battling illness for the past two days although he hopes to participate tomorrow after medical checks and rest.