The Italian's win, three places ahead of Honda's Marc Marquez, keeps the ultimate prize on the table at the championship's final round in Valencia in a fortnight's time.
With Marquez needing only to maintain a lead of more than 25 points over his Italian rival, Dovizioso knew even a win might not be enough in Malaysia.
A barnstorming start from Marquez saw him briefly lead the race at the first corner, suggesting the reigning world champion was in the mood to wrap things up early. But Ducati is a team transformed this year, and both Dovizioso and teammate Jorge Lorenzo soon began to exert a tight grip on the race.
Both riders soon passed Marquez but needed to overhaul Frenchman Johann Zarco, giving yet another vivid display on his satellite Tech3 Yamaha, to keep the title in reach. Zarco's choice of a soft rear tire eventually proved his undoing as Lorenzo then Dovizioso passed him.
With Lorenzo looking composed at the front, the prospect of team orders seemed as though they might come into play. But with the laps running down a mistake from the Malaga man let Dovizioso charge through and take the win -- his sixth of a remarkable season.
"It was a truly perfect weekend," Dovizioso told reporters after the race. "We were quick in every session, both in the dry and in the wet, and today in the rain we dominated."
The Italian, who also won in Sepang last year, was quick to praise his Ducati.
"Here at Sepang, Jorge and I really had a bike advantage because our Desmosedici was very fast, and we managed to administer the gap in the best possible way, even though track conditions were very difficult because there wasn't much grip."
Marquez, who saw his Repsol Honda team clinch the constructor's title, was philosophical.
"I got a good start, and I tried to push at the beginning because I didn't want to be stuck in the middle of the group," he said after the race.
"Then I tried to find the feeling and the pace but I saw that both the Ducatis were very fast, so I decided to not take too many risks, to be calm, and to get good points for the Championship."
Marquez in the driving seat
Lorenzo, who is gradually getting to grips with the Ducati after a mixed debut season with the Bologna outfit, recognized the significance of his teammate's win.
"When I almost crashed at turn 15 and Andrea passed me I realized that I wasn't going to be able to fight for the win. I know exactly how important a world title is for Ducati; Dovizioso has had a fantastic season and deserves to fight for the championship right down to the last race."
Marquez remains hot favorite to lift his fourth premier class title, but MotoGP can and will brutally punish mistakes. With a 33-point lead reduced to 21 the Catalan is not taking anything for granted.
"We need to keep focused, to train well this week, and to work to be at 100% on Sunday in Valencia without relaxing too much with the advantage we have," he said after the race.
"I know it will be very difficult at Valencia because it's a track where Marquez always goes well," Dovizioso acknowledged.
"We'll be going to Spain with confidence to try and bring home the victory."