They were the only two Central American countries to maintain a diplomatic freeze on the communist island-nation.
In El Salvador, the winner of this week's presidential election, Mauricio Funes, said ties would be re-established as soon as he takes office.
Announcing a similar move, Costa Rican leader Oscar Arias said: "We have to be capable of adjusting to new realities."
For Mr Arias, the decision represents a dramatic change in attitude.
He once compared Cuba's rights record under Fidel Castro to that of Augusto Pinochet's regime in Chile.
And Havana has labelled him a "vulgar mercenary" and a puppet of American imperialism.
Source: FOCUS Infromation Agency