Ramos kicked five penalites and a conversion at a sold-out Stade de France as the hosts, leading contenders for the title, started the tournament in style.
Winger Mark Telea claimed two tries for three-time winners All Blacks, who had led 13-9 with more than half an hour to play but went on to lose their first ever World Cup pool game in hot and humid conditions in Paris.
"We found it hard to get going especially with the pressure of an opening match at home and everything that followed," France captain Antoine Dupont said.
"There was an All Black team who put us under a lot of pressure at rucks but we managed to be serious and rigorous throughout the match and we finished it well."
After a colourful opening ceremony the All Blacks' Haka was well respected by the sold-out Stade de France crowd as well as by Les Bleus.
New Zealand made a late change as captain Same Cane was ruled out, Tupou Vaa'i coming in from the bench with Dalton Papali'i moving from blindside flanker to the openside as No. 8 Ardie Savea took over as skipper, leaving Ian Foster's side light at the breakdown.
"It's tough when you lose your skipper, the boys that came in filled the job right, unfortunately we didn’t get the win," Savea said.
"We lost the battle tonight but we still got a war to win."
The All Blacks needed just 93 seconds to lay to bed any idea of a hangover from last month's record defeat by South Africa as Telea collected a Beauden Barrett crosskick into the corner to score and silence the French supporters.
Ramos then cut the score to 5-3 with a penalty after Papali'i was pinned at a breakdown.
After a frantic opening quarter, Ramos put his side into the lead with a second penalty before Mo'unga responded with one of his own to make it 8-6.
After 25 minutes, the players benefited from the first of two water breaks with temperatures reaching 29 degrees Celsius (84 degrees Fahrenheit).
New Zealand-born France tight-head prop Uini Atonio had the advantage at scrum time and won a penalty that Ramos slotted to make it 9-8 at half-time, with the players seeming happy to escape the sauna-like conditions for a few minutes.
Telea claimed his second try in the opposite corner, from an original Savea chip kick just three minutes into the second period.
Mo'unga missed another conversion as the home supporters voiced their displeasure at the playmaker's assist for Telea, claiming a forward pass, but New Zealand led 13-9.
- Jordan yellow -
The battle at scrum-half between Dupont and Aaron Smith was highly anticipated and it was All Black Smith who had the upper hand, scragging Dupont down with well-timed tackles twice just after 50 minutes.
With little under half an hour play, Les Bleus came within inches of the New Zealand line but Mo'unga's perfect last-ditch tackle stopped Damian Penaud from grounding the ball.
Two minutes later, Penaud got his try as fly-half Matthieu Jalibert stepped Savea and drew Telea to find him in the same corner before Ramos' touch-line conversion made it 16-13.
Things got worse for New Zealand two phases after the restart as winger Will Jordan was sent to the sin-bin for taking Ramos out in the air, with the momentum swinging massively to the home side.
Ramos added a fourth penalty to make it 19-13 before Jordan returned from the sin-bin to set up a very tense finish.
Jordan was in hot water shortly after his return for a similar incident but referee Jaco Peyper chose to only award a penalty for his offence, which Ramos gladly kicked to make it 22-13 with seven minutes to play.
The cherry was put atop the French cake as Melvyn Jaminet went over with two minutes to play, sending the home crowd into wild celebrations.