Belgium impressed in an unbeaten qualifying campaign, becoming the first European nation to book their place at Russia 2018.
But Roberto Martinez's side struggled to break Panama down in a flat first half at the Fisht Stadium on Monday, requiring a moment of magic from Mertens to break the deadlock in the 47th minute.
Panama almost mustered a rapid leveller but Thibaut Courtois made a smart stop to keep out a low strike from Michael Murillo, before Lukaku struck twice in six minutes to settle the contest.
Lukaku nodded in a sensational Kevin De Bruyne pass and the Manchester United striker then scored a cute chip, though Panama can take heart from a promising display ahead of games against England and Tunisia.
Martinez's golden generation have been tipped as potential champions, but Belgium - beaten by Wales in the Euro 2016 quarter-finals - will likely need to improve on an often-underwhelming performance when they face stronger opposition.
Panama made a nervy start to their World Cup bow with Yannick Carrasco and Mertens forcing early saves from goalkeeper Jaime Penedo.
Eden Hazard hit the side-netting after pouncing on a loose backpass from Roman Torres, Panama's captain making amends with a terrific touch on a low De Bruyne right-wing cross that ensured Lukaku could not tap in at the back post.
The Belgium captain, deputising for the injured Vincent Kompany, shook off the blows and forced Penedo into a save with his legs, as Panama remained relatively comfortable.
Belgium struggled to create clear openings in the first period but within two minutes of the restart they led thanks to an early contender for the goal of the tournament.
Panama failed to clear their lines properly and when the ball fell to Mertens on the right side of the penalty area, the Napoli forward thumped a dipping volley that flew past Penedo.
De Bruyne almost swiftly doubled the lead but narrowly missed the target with a 25-yard free-kick that curled away from Penedo's right-hand post.
When wing-back Carrasco switched off at the back, allowing Edgar Barcenas' pass to drift over his head, Courtois had to be alert to smother an effort from Murillo.
That proved to be Panama's best chance of claiming a draw and Belgium doubled their lead in the 69th minute after VAR ruled Lukaku was marginally onside.
Hazard and De Bruyne combined brilliantly on the edge of the box, the latter's sublime floated cross to the back post providing Lukaku - who hit 11 goals in qualifying - a simple headed finish.
And when Panama lost possession in their own half, Belgium sprung a clinical counter-attack with Hazard's pass perfectly timed for Lukaku to run clear and lift a fine finish over the onrushing Penedo, showing Belgium will be a World Cup threat if they hit top gear.
Key Opta stats:
- Belgium are now unbeaten in their last 10 World Cup group games (W5 D5 L0), winning each of their last five.
- Each of the last 11 goals that Belgium have scored in World Cup matches have come after half-time.
- Belgium have won all 13 international matches that Dries Mertens has scored in.
- Romelu Lukaku has been directly involved in 13 of Belgium's last 19 goals (11 goals, two assists).
- Eden Hazard has been directly involved in 16 goals in his last 15 appearances for Belgium (eight goals, eight assists).