For each PKM you defeat, prestige gain is based on your highest CP on the team (even if not used in battle).
[Edit - deleted example - see other reply below]
Another alternative - just hit the first one and run - I recently hit a level 7 gym with 1400 Ursa, followed by 2 Blissey's - I actually had 2 Machop's under 700 (awaiting evolution) with OK fighting moves that were able to take care of him - required 8 rounds of fighting and revives/potions, but I was rewarded by putting in a 3rd blissey that has made that gym crazy strong for the area it is in!