Rast had held his lead at the start while Wittmann started 18th after a turbocharger problem in qualifying had prevented him from setting a competitive lap.
But within four laps, Wittmann had climbed into the top 10 and made it as high as sixth when he stopped nine laps later as the first of the frontrunners to make a mandatory pitstop.
Rast followed two laps later and Rockenfeller crucially ran another two laps longer and the 2013 DTM champion used his new tyre advantage to hunt down second-placed Wittmann.
The Audi driver first looked to pass into the Strubben hairpin and was rebuffed by Wittmann and Rockenfeller could not make a move stick at the Geert Timmer Bocht chicane either.
But on the following lap, Rockenfeller was able to use the exit at the Strubben to make a greater exit onto the back straight to surge past Wittmann for second.
Rast had held a lead of just over six seconds heading into the second half of the race, but the gap quickly disappeared and the Audi driver was called into the pits for a second set of tyres.
Rockenfeller, whose last DTM victory came at Zandvoort in August 2017, then assumed the lead to win by 4.5s over Wittmann.
Nico Muller made it back-to-back podiums at Assen after taking third place once he had overhauled WRT Audi driver Jonathan Aberdein.
Aberdein was put on the back foot after a poor start from the front row meant he was swarmed by the likes of Audi’s Robin Frijns and Loic Duval, as well as BMW’s Sheldon van der Linde, but the WRT driver recovered to fourth.
Rast managed to seal fifth place after storming past Frijns and R-Motorsport Aston Martin’s Daniel Juncadella on the final lap after a late recovery following his second pitstop.
Juncadella was an impressive seventh place, following on from Aston’s best DTM result of sixth at the Norisring, after R-Motorsport opted to have the four Aston drivers run further than anyone else in the first stint.
Paul di Resta followed his teammate across the line in eighth after recovering from a trip across the gravel early on when van der Linde pushed him off the track at the Strubben.
Jamie Green and Pietro Fittipaldi rounded off the points-paying positions to make it seven Audis inside the top 10, as several drivers fell down the order by making second stops.
Joel Eriksson retired from the race after a huge plume of smoke came from the rear of his BMW on the long run to Haarbocht, while Bruno Spengler and Jake Dennis also retired with a front axle problem and brake issues respectively.