The goal also broke Hamsik's scoring drought. This season was the first time in his 11 years at the club that the Slovakia international had reached October without scoring.
"I really want to match Diego, but at this point it's not something impossible. When it happens it happens," Hamsik said. "I missed scoring but the team's results are more important."
The goal also saw the 30-year-old Hamsik emulate another one of Napoli's iconic scorers, Attila Sallustro, by scoring in 11 consecutive seasons at the club.
While Hamsik may have been struggling in front of goal recently, Napoli certainly haven't.
The result against Cagliari means Napoli have now outscored their opponents 25-5 with at least three goals in each of the team's Serie A matches this season.
Napoli are now the only side with a perfect league record after six-time defending champions Juventus drew 2-2 at Atalanta.
After finishing in the top three in five of the last seven seasons, Napoli are looking like they could win their first title since Maradona led the club to their only two Scudettos in 1987 and 1990.
"Seven victories in seven matches is something incredible. The road is still long but we are confident," Hamsik said.
"This is the strongest and nicest team in which I have played because we are aware of our strengths and that we can fight for the title until the end.
"October will be a decisive month. We have to play many decisive matches both in the league and in the (UEFA) Champions League."
After the international break, Napoli faces title rivals Roma and Inter Milan in the league, on either side of a tough test against Manchester City in the UEFA Champions League.
And Napoli manager Maurizio Sarri will be delighted to have his captain back in form in front of goal.
"He's a star player," Sarri said. "Marek can have a month where he's not at his best but then he is back to being how he always is and when that's the case everything is easier for us."
Sarri, however, was eager to play down his side's title chances.
"It's been six years that people have been saying we could bother Juventus but in the end they still win, which means that they're still a step above everyone else," Sarri said.
"We've played seven matches, which is just 40 days of the season. Let's see how things develop long-term.
"Anyone can do it for a month, few for six months and only one squad for a year."
But, going back to last season, Napoli have now won 12 consecutive Serie A games, scoring 42 and conceding only nine.
They are also undefeated in 19, a better run than they had from the end of the 1988-89 season to the beginning of 1989-90 - at the end of which the southern side won their second league title.
If they are successful in their pursuit of a third, Hamsik will take up his rightful place next to Maradona at the top of the list of Napoli greats.