With four laps to go, Hayden finally got in front of Dovizioso - the American diving inside into turn one, with Dovi retaliating immediately, only to be squeezed gently to the edge of the track by Hayden.
But Dovizioso wasn't finished and threw his JiR Team Scot machine inside Hayden into the next hard-braking zone. A small mistake by Hayden then allowed Dovizioso a little breathing room, and put Hayden briefly in danger of attack from Gresini's Shinya Nakano, but the 2006 world champion was back on the #4's rear wheel by the start of the last lap.
Dovizioso, impressive under braking throughout the race, held tight lines for the final lap and was rewarded with his first ever MotoGP podium - and the first podium this season for a satellite Honda rider - by 0.3sec from Hayden.
Nakano had overtaken Casey Stoner with six laps to go and the Ducati Marlboro star appeared to be suffering badly in the exhausting 42 degree heat, but hung on to sixth by three seconds ahead of Rizla Suzuki's Loris Capirossi.
That sixth position means Stoner has now secured second in the 2008 world championship standings, the Australian holding a 26 point lead over Pedrosa heading into next weekend's Valencia season finale.
Colin Edwards was the only Tech 3 Yamaha rider to reach the flag at Sepang, in eighth, after rookie team-mate James Toseland fell early in the race. Behind Edwards, Chris Vermeulen was the second GSV-R home in ninth, with Randy de Puniet tenth for Honda LCR.
Kawasaki riders John Hopkins and Anthony West finished eleventh and twelfth, ahead of Alice's Sylvain Guintoli and Gresini's Alex de Angelis.
The second Alice Ducati of Toni Elias was forced to serve a jump start penalty, but still finished ahead of factory Ducati rider Marco Melandri to claim the final world championship point. Suzuki wild-card Nobuatsu Aoki was 17th and a distant last.
Malaysian Grand Prix:
10. de Puniet
14. de Angelis