Diego Perotti fired straight at Pyatov as Roma chased a second and Dzeko then nearly struck again with a wonderful curling shot that just faded wide, before Shakhtar redoubled their efforts.
The Italians, who lost the first leg 2-1, went through on away goals.
Mallenco twice worked for the matches of Shakhtar in the Champions League in the 2014-2015 season, "miners" in the 1/8 finals of painted draw with Bayern (0:0), and in the autumn of previous year thanks to the double beat Bernard "Feyenoord" (2:1).
It took Dzeko just 22 seconds to work Andriy Pyatov for the first time, but Shakhtar would not bow easily to the hosts' early pressure and were soon knocking the ball around with confidence in the Roma half.
"My team played with focus tonight, perhaps without as much quality in the final third, but we knew that sooner or later they would make a mistake and we'd pounce on it", Di Francesco told Mediaset.
The two teams went into the interval level, with the visitors looking the more unsafe of the two in the opening stages. "I don't have a preferred opponent: they are all strong teams, but we will play to win against anyone".More news: Buy Star Wars: The Last Jedi (with bonus content) on Amazon
More news: TDP protests in Parliament demanding special status for Andhra Pradesh
More news: Apple Announces WWDC 2018, Registration Now Open
A straight red card for Ivan Ordets in the closing stages helped the Giallorossi's cause as they reached the last eight of the Europe's elite club competition for only the fourth time in their history.
Alessandro Florenzi came close to turning in an own goal at the 10-minute mark, one that would have been a crippling blow to Roma's comeback hopes.
A composed 52nd-minute finish from Edin Džeko was enough to claim victory for Roma at home to Shakhtar Donetsk and send the Italian side through after the tie finished 2-2 on aggregate.
Going down to 10 men left Shakhtar in disarray and their frustration showed when Facundo Ferreyra, who scored in the first leg, plowed into a ball boy on the sideline and the youngster fell backwards over an advertising hoarding.
The Ukrainians had last reached the quarter-finals in 2011, which came at the expense of Roma.
"The standing ovation is not for me but for everyone, we are deservedly in the quarter-finals", said Dzeko of the applause which accompanied him off the pitch.