The Manchester United forward's effort set the Three Lions on their way to victory in their final warm-up match prior to the World Cup, with Danny Welbeck sealing the result with a second-half header.
Manager Gareth Southgate made 10 changes to the team that beat Nigeria 2-1 on Saturday, with John Stones the one player to keep his place, while Liverpool's Trent Alexander-Arnold made his debut at right wing-back.
These two teams played out a goalless draw in their final group game at the World Cup in 2014, where Costa Rica went on to reach the quarter-finals, but Rashford made sure there would be no repeat of that result with a stunning goal 13 minutes in – his first for England since last September.
It was just reward for a fine first-half performance but England lost some of their rhythm after the break, as Southgate made a number of changes, including handing goalkeeper Nick Pope his first taste of international football.
Substitute Welbeck made certain of the win 14 minutes from time, though, diving to head home Dele Alli's cross, as England earned a vociferous send-off from the Leeds crowd before their opening match in Russia against Tunisia on June 18.
Phil Jones clipped the crossbar with a header but it was Rashford who looked brightest in a positive early spell for England, and it was fitting for him to break the deadlock.
Collecting Ruben Loftus-Cheek's pass, Rashford turned into space and unleashed an unstoppable strike from 25 yards out that dipped over Keylor Navas and into the left-hand corner.
Jamie Vardy was denied by a flying Navas from point-blank range as England pressed their advantage, although Jack Butland made a good save to deny Johan Venegas after a rare Costa Rica break.
England's pressure resumed after half-time, with Navas palming away a fierce Jordan Henderson strike before the resulting corner saw Harry Maguire's header cleared off the line by Bryan Oviedo.
16 - Danny Welbeck has now scored 16 goals in his 39 games for England, three more than any other player in the Three Lions World Cup squad. Option. pic.twitter.com/1bH2PDTfio— OptaJoe (@OptaJoe) June 7, 2018
Both sides made a host of alterations around the hour mark, which included a return to international action for the fit-again Christian Bolanos, while Burnley keeper Pope made his senior England bow in place of Butland.
The game seemed set to finish at 1-0 until Welbeck made the most of his first clear opportunity since coming on, stretching to nod in Alli's clever cross from the left for his 16th England goal, potentially giving Southgate more positive selection headaches ahead of the Tunisia clash in Volgograd.