A blunder by Nigeria goalkeeper Vincent Enyeama handed Greece their first victory at the fifth attempt in two World Cup finals.
It also maintains their slim hopes of an appearance in the next stage although their final Group B game is against Argentina.
Enyeama, whose side were down to 10 men following Sani Kaita's red card, failed to deal with a soft shot from Alexandros Tziolis in the 72nd minute.
The rebound fell to Vasileios Torosidis, who toe-poked the ball home to give Greece victory.
Nigeria now face an early exit. Yet the game had started so well for them. They took the lead after 16 minutes following a defensive howler by their opponents.
Greece failed to cut out an inswinging free-kick from Kalu Uche and goalkeeper Alexandros Tzorvas was left rooted to the spot as the ball nestled in the net behind him.
While Uche celebrated, Tzorvas was left shaking his head in disbelief.
It was an early setback for Greece following their opening-day defeat by South Korea.
They responded 13 minutes later when skipper Georgios Karagounis tried to chip Enyeama from distance but the goalkeeper was able to make a comfortable save.
Then Karagounis floated in a corner only for Liverpool defender Sotirios Kyrgiakos to send his header high over the bar.
The match took a dramatic twist in the 34th minute when Nigeria were reduced to 10 men.
Kaita was handed a straight red card by referee Oscar Ruiz following a tussle with Torosidis. Kaita showed his studs to the defender and was immediately banished to the dressing room.
Greece coach Otto Rehhagel reacted by bringing on striker Georgios Samaras instead of defender Sokratis Papastathopoulos two minutes later.
And they almost drew level in the 39th minute only for Enyeama to superbly block a shot from Salpingidis.
Greece stepped up the pace and Samaras then saw his effort cleared off the line by Lukman Haruna.
Nigeria were finally breached a minute before the break when Salpingidis scored the equaliser, his effort deflecting off a defender after Konstantinos Katsouranis had played the ball into his path.
It was a historic moment for Greece - their first goal in the finals.
Nigeria made a confident start to the second half and Uche saw his clever cross palmed on to the roof of the net by Enyeama in the 48th minute.
Greece hit back and Kyrgiakos sent a header at the back post into the arms of Enyeama seven minutes later following a corner from Karagounis.
They kept pushing forward and Thefonais Gekas saw his close-range effort parried by the goalkeeper in the 59th minute.
Nigeria launched a swift counter attack and Aiyegbeni Yakubu's shot was blocked by Tzorvas.
The ball broke to substitute Chinedu Obasi but he somehow managed to find the wrong side of the post when it seemed easier to score.
Nigeria were again grateful to Enyeama in the 68th minute when he clawed away a powerful header from Samaras.
Then came the mistake by the goalkeeper although he did well to beat away Tziolis's effort in stoppage time to prevent Greece extending their lead.Reuse content