The Lotto Soudal rider accelerated with about 50 metres to go to overrun Arnaud Demare (FDJ) and Dylan Groenewegen (LottoNL-Jumbo), who finished second and third.
“It was the big goal to win a stage here at Paris-Nice against some of the best sprinters in the world," Greipel said. "Arnaud Démare is riding very impressive at the moment. I’m glad I could beat him.
"The last seven kilometres we had to fight against a strong headwind, so it was not easy to stay in front. Luckily, with the support from the team, I managed to get in a really good position for the sprint.
"The finish was slightly uphill and suited me well. I am very happy with this victory. The next days I’ll do my best to support Tony Gallopin where I can. Saturday will be a fight man against man and he is really good, I think he can win this Paris-Nice.”
Julian Alaphilippe (Quick-Step Floors) retained the overall leader's yellow jersey after finishing safely in the peloton.
His overall lead will be under threat on the sixth stage which will take the peloton 193.5km across five climbs from Aubagne to Fayence with a summit at the finish.
"Another race starts now. Each of the three stages are going to bring surprises. Tomorrow (Friday) it could be a breakaway, like a fireworks display," Alaphilippe said. "If I have to attack to defend my yellow jersey, I'll do it."

Dan Martin (L), Julian Alaphilippe (C) and Alberto Contador (R) will battle for the Paris-Nice win. Source: Getty