A man charged with stabbing a 20-year-old man to death at Rosebery in Sydney's south overnight, was allegedly a friend of the victim.

Emergency services were called to Tramway Street at Rosebery at 9:30pm (AEDT) following reports of a man having a heart attack.

Officers arrived to find Alex Bargiatakis in cardiac arrest, suffering a stab wound to his chest.

Paramedics performed CPR but were unable to revive him.

Police arrested 21-year-old Jarrod Mitchell not far from where the stabbing occurred.

The ABC understands the men were friends.

Mitchell was due to face Newtown Local Court charged with murder but the matter was adjourned until next week.

Neighbours who live on the street said the young man was stabbed outside a house where a group of university students were living, but it is unclear if Mr Bargiatakis lived there.