Pedro matches Italy legend Riva's 52-year Cagliari record
Former European champion and World Cup runner-up Riva, who led Cagliari to their only Italian title in 1970, was the last player in the club to score five in the first seven league matches back in 1968.
Riva, Italy's all-time top scorer with 35 goals in 42 games and also Cagliari's with 164 goals in 315 league games, celebrated his 76th birthday on Saturday.
"I changed the system to favour Joao," said Cagliari coach Eusebio Di Francesco. "I wanted to wish a happy birthday to the great Gigi Riva, a symbol for Cagliari."
Sampdoria had to play over half the match a man down after Tommaso Augello was sent off for bringing down Nahitan Nandez five minutes before the break.
Brazilian Pedro opened the scoring two minutes into the second half when he won and scored a penalty kick after colliding with Lorenzo Tonelli.
Uruguayan Nahitan Nandez connected with a Giovanni Simeone cross to seal the victory after 69 minutes with Riccardo Sottil having a third ruled out for offside.
Sampdoria and Cagliari are 10th and 11th respectively, both on 10 points after seven games, as they push for European football next season.
French forward M'Bala Nzola bagged his first Serie A goals to move Spezia clear of the relegation zone with a 3-0 win at Benevento.
Spezia move into 13th place after the game between the promoted sides, with Benevento in 16th place.
Tommaso Pobega put the visitors ahead after half an hour with Nzola finishing off an Emmanuel Gyasi cross after 65 minutes before nodding in Nahuel Estevez's corner five minutes later.
"I've dreamed of scoring in Serie A since I was a child," said Nzola. "We deserved this win, we showed we can stay in the top flight."
Leaders AC Milan host Hellas Verona on Sunday with champions Juventus, in third, travelling to Lazio, while fourth-placed Atalanta are at home against Inter Milan.