United, mounting a dismal defence of their Premier League title in Moyes's first campaign since replacing Alex Ferguson, kept alive their last remaining hope of lifting a trophy this season.
Van Persie began the Old Trafford comeback with a 25th-minute penalty, awarded after he had been shoved in the back by Jose Holebas.
The Dutchman levelled the tie on aggregate in first-half stoppage time, steering in Wayne Rooney's cross and Van Persie completed his hat-trick with a free kick six minutes after the break that left Olympiakos keeper Roberto rooted to the spot.
"We had the desire to win. We owed ourselves a good result and the fans, the manager, everyone. It was a great result and hopefully it can kick start our season," Rooney told Sky Sports.
Ryan Giggs, recalled for his first start since late January and instrumental in United's comeback, added: "It was always going to be tough not to concede a goal and to score three goals but we managed it. The crowd got us over the finishing line.
"Hopefully tonight can be the turning point in our season."
Only twice in their long European history had Manchester United recovered from a 2-0 first leg defeat to advance, the last time 30 years ago when they came back from the same first leg score to beat Barcelona 3-2 on aggregate in the European Cup Winners Cup quarter-finals.
A repeat performance appeared possible after United started with a much brighter tempo than they showed at any time in their humbling 3-0 defeat by Liverpool in the Premier League on Sunday.
Giggs picked out Wayne Rooney to head against the foot of the post after 18 minutes and it was from another angled delivery that Van Persie was pushed over by Holebas to put United ahead from the spot.
Giggs was involved in United's second, finding Rooney with another flighted pass for the striker to cross low for Van Persie to steer past Roberto.
United could never relax at the back with Olympiakos a constant threat on the counter-attack and it needed a superb double-save from goalkeeper David De Gea to keep the Greek side out.
He first kept out a header from David Fuster, then the follow-up from Alejandro Dominguez to keep United in the tie.
Van Persie's free kick early in the second half proved decisive, although the Dutch striker was carried off on a stretcher in the final minutes with an apparent leg injury.