Diego Cordovez, Ecuador's UN ambassador, made the announcement on Wednesday after talks between Gert Rosenthal, the Guatemalan foreign minister, and his Venezuelan counterpart Nicolas Maduro at Ecuador's UN mission.
The choice of Panama as a compromise candidate now has to be endorsed by the UN Latin American and Caribbean Group and the UN general assembly.
"The two foreign ministers have agreed on two issues - [first] both will withdraw their candidacy to the Security Council, and, second, Panama will be the country that the three of us will present to the [Latin American] group," Cordovez said.
Guatemala, backed by the US, has won all but one rounds of voting in the UN's general assembly over the past three weeks in the fight for the council seat being vacated by Argentina at the end of the year.
However it had failed to obtain the required two-thirds majority needed to win one of the 10 rotating council seats for Latin America.
The row over the council seat had become the latest issue in increasingly fraught relations between Venezuela and the US.
The US had accused Venezuela of being too confrontational over the seat, while Hugo Chavez, president of Venezuela, attacked the US for its "crude blackmail" of other nations in a bid to secure the seat for Guatemala.
The 15-member council also has five veto-wielding permanent members: Britain, China, France, Russia and the United States.