The stabbing occurred at about 12:50 a.m. in the 1600 block of La Salle Avenue.
The victim, Douglas Johnson, a San Francisco resident, was pronounced dead at the scene, according to the medical examiner's office.
Police said Johnson was in the passenger seat of the car and stepped out to speak with another man. The man, described only as in his mid-40s, stabbed Johnson in the chest.
No arrests have been made in the case, but there were witnesses and an investigation into the murder is ongoing, police spokeswoman Sgt. Lyn Tomioka said.
Johnson's death marks the 22nd homicide reported this year by San Francisco police.