Claudio Ranieri's side claimed their third successive league victory after beating Fiorentina and Lazio to move level on points with third-placed Atalanta.
"Last year we were in (a) full battle to avoid relegation and it was difficult to challenge Atalanta," said Ranieri.
"I told the lads I wanted to see courage against Lazio and Atalanta. We gradually gained confidence and were ready when the opportunities arose."
Quagliarella opened the scoring after quarter of an hour with his fourth goal in as many games, but the veteran striker was denied a second from the penalty spot.
Danish midfielder Morten Thorsby added a second before the hour mark, with Jakub Jankto sealing the points in injury time.
Colombian striker Duvan Zapata pulled a goal back for Atalanta with 10 minutes to go from the penalty spot.
Gian Piero Gasperini's Atalanta scored 13 goals in their first three matches, but have now conceded seven in two games after losing 4-1 at Napoli last weekend.
"Today I did a bit (of) experimenting, it was a sort of construction site," said Gasperini.
"You want to bring in new players but when you play at high levels you can't do too many experiments."
After their defeat in Naples, Atalanta had opened their Champions League campaign with a 4-0 win at Danish club Midtjylland.
Gasperini made seven changes to his side with Sam Lammers and Josip Ilicic starting, the latter playing at home for the first time in three months.
Atalanta captain Papu Gomez was denied an early goal, before Mikkel Damsgaard set up Quagliarella to score.
A Johan Mojica handball gave Sampdoria the chance for a second but Marco Sportiello kept out the effort of Quagliarella, 37, from the spot.
Thorsby got his head to a Jankto cross for Sampdoria's second before Zapata revived home hopes, converting his penalty after Keita Balde fouled the Colombian.
Senegalese Keita made up for his error, sending Jankto through on goal to net a third two minutes into injury time.
Inter Milan travel to Genoa later on Saturday with Lazio at home against Bologna.