Dries Mertens and Michy Batshuayi were also on target for Belgium while Eden Hazard impressed with creativity and speed for the hosts, who start their World Cup campaign on Monday against Panama in Sochi.
Costa Rica, who were quarter-finalists four years ago and will play Brazil, Serbia and Switzerland in Group E, went ahead against the run of play with a goal by captain Bryan Ruiz in the 24th minute.
Mertens equalised before Lukaku scored either side of halftime and Batshuayi completed an impressive win for Belgium, whose team are hoping they can finally do justice to their golden generation tag in Russia under coach Roberto Martinez.
They disappointed in previous outings at major tournaments, losing in the quarter-finals to Argentina at the last World Cup in Brazil and then at the same stage to Wales at Euro 2016, both under Marc Wilmots.
There was confusion around Monday’s other friendly, also featuring two Russia-bound sides, which was played behind closed doors at the home of Groedig, a village near Salzburg.
Details of the game were not even available on betting websites, which generally carry results from even the most obscure matches, and there was outrage on social media, especially among those who had placed bets on the outcome.
The match appeared to kick off half an hour late and some media reports said that Senegal won 2-0 after Kim Young-gwon put through his own net and Moussa Konate scored in the 90th minute.
Neither federation, however, had published the result on its website several hours after the end of the match, although the Senegalese website had their team’s starting 11.
FIFA could not immediately be reached to comment on whether the game would be considered a full international.
The World Cup kicks off on Thursday when hosts Russia play Saudi Arabia.