Derby County 3 Wrexham 1
The 19-year-old Italian, who is on loan from Arsenal until the end of the season, was the difference between the teams and Derby had some anxious moments before his third goal sealed their passage into the fourth round.
Wrexham battled bravely after falling two goals behind early in the second half and they might have earned a replay but for a marginal offside decision which ruled out a Steve Evans goal.
But Derby should have spared themselves some nerve-jangling moments and they were cruising until Bob Malcolm presented Lee McEvilly with an unexpected lifeline.
Wrexham did their level best to embarrass the Championship pace-setters but Lupoli finished them off six minutes from the end although the 2,900 visiting fans applauded their side off at the final whistle.
Certainly they could be proud of the way a club struggling in League Two gave a team with one eye on the Premiership a thorough examination and, with better luck and better finishing, it could have been an even better day out for the Welsh outfit.
McEvilly almost scored in the eighth minute but his low shot lacked the power to beat Stephen Bywater and Derby had to wait until the 24th minute for their first shot on target.
But their next effort on goal opened the scoring when Morten Bisgaard sent Lupoli in on the right and he fired high into the net for his eighth goal of the season.
Poor marking allowed Lupoli to head in his second from six yards and that appeared to be that until Malcolm gave Wrexham hope.
The midfielder headed the ball into his own six-yard area where McEvilly pounced and rounded Bywater to score.
Suddenly, Wrexham sensed they might cause an upset and Shaun Pejic was only just wide with a header from a Darren Ferguson free-kick.
Another Ferguson cross saw Chris Llewellyn flick the ball on and Evans rammed a shot in at the back post but the linesman had raised his flag for offside.
Derby had lost their earlier composure and shape and Evans had another good chance to equalise in the 79th minute when he climbed to meet a Ferguson free-kick but his header was straight at Bywater.
Derby finally eased their nerves six minutes from time when substitute Ryan Smith crossed from the left and Steve Howard struck the crossbar before Lupoli headed in the rebound to become the first Derby player to score three times in a game since Paul Simpson against Tranmere in April 1996.