Shank them. Shank them before they see you.
You can stand and fight, but a dagger or even a short sword/long dagger is at a significant disadvantage against someone wielding a long sword. The problem isn’t necessarily a better weapon (it is) or a more skilled fighter, the trouble is reach. When it comes to weapons, reach and weapons that are further up the technology tree will have a significant advantage over one that’s further down. We don’t tend to think about medieval weaponry and swords, particularly long swords as technology but they are. So, let’s break weapon lengths down. Someone working with a sword or club will be at a disadvantage against someone wielding a staff or spear, particularly if that staff or spear is metal plated and can take someone hacking at it. They did actually do this in Europe. When facing someone carrying a weapon that is the same as your own, spear versus spear, sword versus sword, then it becomes an actual contest of skill. The long sword has greater reach than a short sword and the dagger, putting the dagger wielder at the disadvantage because to win they have to fight their way past a very dangerous weapon before they can even get into striking range. Throwing a shield in on top of that is just unfair.
For you, the comparison is similar to punches versus kicks, someone who primarily uses kicks will keep the other person out of range and if they’re kept at range, they can’t do damage (unless they can catch the leg). Cun Lee does very well on the MMA circuit, for example, because most of the fighters he faces come from a boxing/wrestling/jiujutsu background and he uses a mix of taekwondo and muay thai kicks to keep them at range and knock them out.
So, how do they fend off an opponent with superior force? The best answer is: don’t fight on their terms. Stop and think about the strengths of the dagger as a weapon, it’s either a supporting add on used in desperate circumstances or its a weapon of surprise. It can be hidden fairly easily and does incredible amounts of damage swiftly in close quarters, in the ranges where the sword and staff become less useful (if you’re working against a European long sword watch out for the pommel, it’s a close quarters weapon if the sword is already out of it’s sheath…a shield can also be used as a bashing weapon to knock someone back). The character just has to figure out how to get there.
So, disengage, run away, come back later when they don’t expect it and shank them. Or take them by surprise the first time out, then run and hide. It’s not noble, it’s not pretty, but it works.