The 19-year-old followed in the footsteps of his father Paolo and grandfather Cesare, two Milan greats, by scoring in Italy's top flight with a 48th-minute header, which sent the Rossoneri top of the table.
- Don't have ESPN? Get instant access
"Daniel has talent, technique, he reads the game well and knows how to integrate himself," Milan coach Stefano Pioli told DAZN.
Milan climbed to first place with 16 points ahead of the rest of the weekend's fixtures. Spezia are 17th with four points.
"It is always a complicated match here. They play well and had a good match, but we fought together and did what we always do. I am happy for everyone, it is difficult to win here but we did it," Diaz told DAZN.
Pioli opted to hand Maldini his first start after a gruelling run of four games in 10 days for his side.
The coach's decision paid off when the teenager got in front of his marker to head in Pierre Kalulu's cross after the break, following a first half lacking in chances.
Maldini became the third generation of his family to score for the club after his grandfather Cesare and father Paolo, both former Italian and European champions with the Rossoneri.
The goal came 13 years and 179 days after Paolo's last Serie A strike in 2008, while Cesare last achieved the feat 60 years and 22 days ago in 1961.
A beaming Paolo Maldini, who is now technical director at Milan, was in the stands to celebrate his son's achievement, and Pioli had some advice for the youngster after the game.
"He needs to be a bit quicker to lose his marker. Today (Spezia midfielder) Mehdi Bourabia was tracking him closely and he should have got a few metres away from him," Pioli said.
"If you don't do that you have less time to play. He can only develop and he has everything to do well in the future."
Rafael Leao was inches away from doubling Milan's lead when his looping shot hit the inside of the post, while Giulio Maggiore squandered a glorious chance for Spezia by firing over from four yards.
Thiago Motta's side drew level on the 80th minute when Verde's shot hit Sandro Tonali to wrong-foot the goalkeeper and go in, but Alexis Saelemaekers picked out Diaz on the edge of the six-yard box for the Spaniard to net the winner four minutes after coming on.