Cheyenne Antoine, 21, was arrested after the police discovered the photograph, which showed her wearing a belt later found alongside 18-year-old Brittney Gargol's body.
Antoine then accepted responsibility for her best friend's death but claimed that she did not remember killing her.
Gargol was found near a landfill site in Saskatoon, Saskatchewan, after being strangled to death, with the belt used to kill her lying close to the body.
"It's quite remarkable how the police developed this information", the crown prosecutor Robin Ritter told the court.
At first, Antoine lied to detectives, admitting she had been with Gargol earlier in the evening but had left the party to spend time with her uncle.
She added that Gargol had been her best friend and that they had been out drinking the night of the incident.
Having noted the belt, police used a series of social media posts to chart a timeline for the women's movements on the night of Gargol's death. An anonymous tip eventually led police to a witness, a person who Antoine had hysterically confessed the crime to that evening. "It shouldn't have ever happened".
Antoine was sentenced to seven years in jail for manslaughter.
Antoine was condemned to seven years for manslaughter.
In a victim impact statement, Gargol's aunt, Jennifer Gargol, expressed her sorrow at the loss.
Investigators arrested Antoine past year after finding the selfie showing her wearing the same belt used to kill her friend.
In comments reported by CTV News, she said: "I'll never forgive myself". I am very, very sorry...
Speaking to the press outside court, she said: "I think that the word motive doesn't have much relevance in this particular case".
Kristi Wickenhauser, Gargol's stepmother, said her young daughter, Gargol's sister, feels guilty if a day goes by that she doesn't think of Brittney.