This question first occured to me when I was playing Dungeons & Dragons. It's a game so obviously you need to keep things simple but as someone who's been fencing it seemed hard to picture someone fighting with a piercing weapon against an opponent with a slashing weapon.
Later, I've started reading on weapons while researching for my novel and I've found out that many types of swords were used in the same time. This brought me to a lot of thinking...
Sorry if it sounds wacky. English is not my first language and although I usually have no problem, my first language seems to be pretty devoid of vocabulary if if comes to stuff like this.
In other words, could you succesfully fight off an attacker with a sabre using a rapier?
Absolutely. These weapons coexisted for a long time and plenty of treatises have been written on the very topic of fighting with one sword typ versus another. Just off the top of my head, Silver's Paradoxes of Defence and Vicento Salviolo's His Practise both deal with the topic of fighting against a rapier with a shorter sword (in Salviolo's case from both spanish and italian fencing tradition perspective).
If you decide to pick up either, keep in mind that these are NOT objective sources on the topic, they're all arguing that their own special school of fencing is the best and some of them do so quite... enthusiastically. Silver for example has kind of the same energy as a newly converted vegan when it comes to blade lengths, devoting literal chapters of his book to how awful and imperfect the rapier is while also conceding that a lot of "his beloved countrymen" sure seem to get hurt by that awful pointy thing. However, in his mind that is not because the rapier is a good weapon but because they just don't know how to face an opponent with a rapier while wielding a shorter blade. Something noone can teach them as well as Silver himself.