The Lufthansa flight left New York on Sunday night en route to Frankfurt with 264 passengers on board.
While over the Atlantic the first officer became "incapacitated" and the pilot contacted Shannon Airport about the possibility of making an emergency landing.
The flight was eventually diverted to Dublin where it landed shortly before 6am yesterday. Lufthansa confirmed that the 'hero passenger' -- who is understood to be a German national -- had flying experience with another airline.
He made himself known to the crew after hearing an announcement that the flight was being diverted.
The passenger who stepped forward to help was allowed to enter the cockpit after explaining his experience and qualifications. A spokesman described his presence on the flight as "very lucky".
Separately a Dublin source added: "It was a miracle to have a man with his background on board. He helped the pilot land the plane in an extremely professional manner. Without him, we could have had a crisis on our hands."
The first officer was later carried off the plane in what one witness described as a "semi-conscious state".
The Lufthansa spokesperson told the Herald: "A Boeing 747 Lufthansa aircraft was forced to carry out an emergency landing at Dublin Airport.
"While the plane was in flight, the co-pilot showed severe symptoms and became incapable of flying.
"The pilot was concerned to a point where it was decided to carry out an emergency landing sometime after 5am."
The airline explained that an off-duty qualified pilot assisted the company's crew in landing the jet.
It is thought that the man offered his assistance after an announcement was made that the flight was diverting.
"It was, of course, very lucky to have a man with his qualifications onboard," the spokesman admitted.
The Air Accident Investigations Unit said that it is carrying out an inquiry into "all circumstances" in relation to the incident.
Those on board the plane were grounded in Dublin for six hours after the incident while a new crew was flown here from Germany.
Officials from the Dublin Airport Authority told the Herald that they became aware of the emergency around 5.30am.
"All emergency procedures were put in place but this operation entered very quickly when the plane landed and it became clear that all was safe," said a spokesman.