Neymar rescued 2014 World Cup hosts Brazil in a tougher-than-expected friendly with Costa Rica scoring the only goal against the run of play in a 1-0 win.