Sneak attack on 5e with surprise?

The story is that our DM had an NPC who essentially "joined our party" but was actually an enemy rogue. In the middle of combat, the NPC ran up and attacked a party member, which the DM deemed as a surprise attack and allowed him to get sneak attack. The goal was basically to one shot a low-level character while the rest of the party was unaware.

The question is: is it normal to allow a rogue to get sneak attack in a situation like this, where the attacker isn’t hidden and otherwise doesn’t have advantage?

I know in the end it’s pretty much up to the DM’s discretion, but I can’t find where that fits in the rules, and it almost resulted in a one-hit KO.