The Prema ace held off Guanyu Zhou for his first feature race win in a race which saw multiple safety cars, including one which led the field to the chequered flag.
Dan Ticktum finished in third after Carlin took a huge gamble on pit strategy, having started eighth before holding out to pit under the second stoppage, which paid off to give him his sixth podium of the season.
Theo Pourchaire, who won the first race of the weekend, finished in fourth for ART, with Jehan Daruvala finishing fifth despite starting in second.
Liam Lawson had been running high up the order for Hitech Grand Prix but lost out after suffering a fault with his fire extinguisher on lap 22.
Zhou moved up to second off the line as Daruvala dropped down to fourth after a poor start, with Liam Lawson also making his way round the outside of his fellow Red Bull junior at the first chicane.
Juri Vips made it up to P7, having started ninth, before Guilherme Samaia lost it out of Lesmo 2, prompting a virtual safety car, which soon became a full safety car.
Racing resumed on lap five, with Zhou applying pressure to Piastri, while Felipe Drugovich moved up to fourth and Lawson forced his way past Zhou around the outside of Roggia, moving into second.
On lap six, Marcus Armstrong and Richard Verschoor made contact in the first chicane, damaging the DAMS and loosening a piece of bodywork on the left side, which eventually flew off onto the racing line.
Ralph Boschung pitted early for fresh medium tyres on lap seven, but suffered from a slow stop, dropping to the back of the pack.
A full safety car was deployed the following lap after contact between Ticktum and Vips at the second chicane. Vips was pulling over with a problem when Ticktum made contact with his rear left, but managed to escape without damage.
This left a flurry of cars heading into the pits, with the whole field bar Ticktum, Armstrong, Christian Lundgaard, Marino Sato and Alessio Deledda taking the free stop, while Enzo Fittipaldi was handed a five-second penalty for an unsafe release.
Sato was forced to retire on lap ten after his car cut out with a loss of electrical power, ending his race.
Action restarted on lap 11, with Zhou and Daruvala battling for the third podium spot. They tussled around the second chicane, with each claiming to have been pushed off the road by the other on both that lap and the following one in the same spot.
Piastri took third from Armstrong on Lap 13, with several drivers still yet to pit, before Deledda suffered damage to the front left after banging wheels with Fittipaldi.
The plucky Prema driver then lunged past Lundgaard into second on lap 15, continuing his post-pit charge.
Another safety car was prompted on lap 22 after Liam Lawson suffered a fault with his fire extinguisher and ground to a halt, ending a race in which he had been looking strong.
The gamble of leaving Ticktum out paid off for Carlin and he emerged in 11th on the soft tyres with far more grip than his rivals.
The green flag was waved once again on lap 25, with Zhou and Piastri heading into the second chicane side-by-side.
Everything almost went wrong for Ticktum after he suffered contact from Boschung into Roggia while trying to make his way through the field, but he managed to keep the car facing forwards and escaped without any damage, despite fears of a puncture.
Ticktum had made it up to third by lap 27 before nipping past Pourchaire into the first chicane two laps later.
On the final lap, the safety car was deployed after Beckmann and Viscaal made contact at the first chicane, leaving the Charouz stranded on track and the Campos in the wall.
Monza F2 – Feature race results:
— to www.motorsport.com