It depends on how you will build the opposing party
You already know the APL (Average Party Level) of your group, 5, and the CR (Challenge Rating) of the encounter, also 5. That means you will have an Average Encounter, not a difficult or easy one.
To create encounters using NPCs with class levels, the easiest solution is to look into the codexes (npc codex, villain codex, monster codex, etc), as Paizo promptly provided statblocks for them (there is a vast catalog in the srd). You will range from guards to brigands to archmages, all with the proper CR, average ability scores and average wealth.
However, when building your own, there are a few things to consider:
- They will have NPC or PC classes;
- How much wealth they will have on equipment;
- How many of them will be on your encounter;
They will have NPC or PC classes
Yes, you have the option to use NPC or PC classes for your NPCs. NPC classes are far weaker than PC classes and thus result in a total lower CR of -1.
For a 5h level NPC, 5 levels in the warrior class will result in a CR 3 NPC (example), while 5 levels in the ranger class will result in a CR 4 (example).
For ability scores, you have two options, basic and heroic, but this is already defined when you pick PC or NPC class levels for your NPCs (SRD reference). If they have NPC class levels, they use Basic ability scores. While NPCs with PC class levels use the Heroic ability scores. So no further adjustment is necessary here.
Basic NPCs: The ability scores for a basic NPC are: 13, 12, 11, 10, 9, and 8.
Heroic NPCs: The ability scores for a heroic NPC are: 15, 14, 13, 12, 10, and 8.
How much wealth they will have on equipment
When deciding what kind of gear the NPCs will have, you basically have three options:
- No gear, this lowers the CR of that creature by 1;
- Standard NPC gear for their level, this doesn't change their CR;
- PC equivalent gear for their level, this increases the CR by 1;
A classed NPC encountered with no gear should have his CR reduced by 1 (provided that loss of gear actually hampers the NPC), while a classed NPC that instead has gear equivalent to that of a PC (as listed on Table: Character Wealth by Level) has a CR of 1 higher than his actual CR.
For a 5th level NPC equipped with NPC Gear appropriate for his level (2,400 gp), their CR is 4. But for a 5th level NPC equipped with PC Gear appropriate for a 5th level character (10,500 gp, over 4x more), his CR is 5, one point higher. Again, NPC or PC class can still adjust this CR, as noted previously.
How many of them will be on your encounter
Now, this is the easiest step, all you have to do is check the individual XP of your NPC and compare to the Challenge Rating table.
A single CR 5 npc will be worth 1,600 XP. Two of them would be worth 3,200 XP, equivalent to an encounter of CR 7. Three of them would be worth 4,800 XP and equivalent to an encounter of CR 8. And so on, the Challenge Rating of the encounter is defined by the total XP given by all challenges.
A quick rule of thumb is to sum their class levels and apply either -1 CR, for PC classes, or -2 CR, for NPC classes. Then adjust the CR by +1 if they have PC gear.
Building the encounter
If you are aiming for a CR 5 encounter, the total XP of a 4-man NPC group has to be 1,600 XP. Which means that you can divide 1,600 by 4 (400 XP, CR 1) and that is the CR of each individual NPC in that group. CR 1 NPCs could either be level 3 NPC classes, or level 2 PC classes, both using NPC gear. For PC geared, they would be level 2 with NPC classes or level 1 with PC classes.
Personally, I would aim at a tougher encounter (CR+2), which gives me room to try stronger npcs (lv1-3s NPCs against lv5 PCs are a roadkill). This would give me a total of 3,200 XP to work with, divided by four would give me a total of 800 XP (CR 3 individually), so they would probably be 4th level NPCs with PC classes. Knowing that PC-geared NPCs would mean they are walking piñata of magic items, I would leave them with NPC gear (no adjustment), so each would have 1,650 gp worth of gear and equipment (magic or not), for a total wealth of 6,600 gp. If all this treasure would be on magic gear, that means the players will get their hands on a hoard equivalent of a 9th level encounter using the Fast Track on the treasure table:
To avoid that, I would probably have them equipped with a few expensive and/or usable gear, like potions, scrolls and one-use magic items. A fraction of that would be spent on actual mundane gear though, like masterwork weapons and armors.
Just a note to keep in mind: Never add a single NPC against a group of four or more player characters, they will wreck her in one or two rounds if they all focus their actions on her.