Correct, the equation for it is basically:
various multipliers*(your_pet_level + 9)*(enemey_pet_level + 5 - your_pet_level)
That last terms caps at a minimum of 0 (or when enemy level is 5 levels lower than your level), so after 4 levels above the enemy, exp goes to 0.
True in general, but just as a note, since the equation is quadratic, there can be specific instances where EXP from a lower level enemy can be higher than that of a higher level enemy if the carry pet levels are on different parts of the level curve.
For example, taking a level 10 carry pet versus Erris the Collector (level 23 pets) with only a safari hat will net around 4703 exp. However, taking a level 20 carry pet versus Cymre Brightblade (level 25 pets) will only a safari hat will net only 3988 exp. They have all the same multipliers, but the quadratic property of the equations, which favor the hill (middle) of the carry pet level range.