Uruguay 3 Costa Rica 3 (6-7 on penalties): Visitors too good from the spot
Johan Venegas came off the bench and scored a dramatic 91st-minute equaliser as Costa Rica sent the friendly to a penalty shoot-out with the score locked at 3-3 in Montevideo.
And Cristian Gamboa netted the match-winning penalty from the spot after Uruguay substitute Guzman Pereira sent his shot too high at the Estadio Centenario.
Uruguay star Luis Suarez unsurprisingly retained his spot in the starting XI as Oscar Tabarez made three changes to the team that beat Oman 3-0 in a friendly last month, with Edinson Cavani, Carlos Sanchez and Alvaro Pereira coming in at the expense of Diego Rolan, Giorgian De Arrascaeta and Gaston Silva.
Alvaro Saborio and Giancarlo Gonzalez came in for Costa Rica, who were 3-1 winners in South Korea last month, with Venegas and Michael Umana dropping out.
Uruguay edged possession during the opening quarter of an hour and they had the best opportunity to hit the front in the 15th minute but Cavani's tame effort was directed straight at Costa Rica goalkeeper Keylor Navas.
Costa Rica slowly started to get themselves into the contest, enjoying spells of possession in midfield.
Suarez went agonisingly close to breaking the deadlock after earning a free-kick just outside the box in the 29th minute, but his set-piece took a deflection and went narrowly wide for a corner.
Costa Rica took the lead against the run of play three minutes before the break, with Saborio - third on the nation's all-time goalscoring list - somehow steering his header in off the post following Bryan Ruiz's inch-perfect cross from edge of the area.
Cavani wasted a golden chance to draw Uruguay level just two minutes into the second half, skying his effort over the crossbar after a neat one-two with Suarez.
Suarez spared his team-mate's blushes two minutes later, when he brought the ball down with his chest and fired past Navas for his third international goal in two matches.
But Uruguay's joy lasted just a minute as Ruiz restored Costa Rica's lead in the 51st minute with a curled effort into the bottom corner.
Cavani's nightmare in front of goal continued on the hour-mark, sending his shot wide of the post from point-blank range.
Teenage defender Jose Gimenez was the next player to come to Cavani's rescue, equalising after looping a header over Navas in the 64th minute.
Cavani finally managed to find the back of the net with a glancing header three minutes later before being substituted.
Uruguay thought they had exacted revenge on Costa Rica following their 3-1 loss in the group stages at the World Cup in Brazil but substitute Venegas combined with Saborio inside the area to level.
Venegas pounced on a knock down from Saborio and fired the ball past goalkeeper Fernando Muslera in the first minute of added time before Costa Rica edged the shoot-out.