Boro now find themselves six points clear of eighth-placed Luton with three games left with Pompey, who parted company with manager Andy Awford on Monday, falling to yet another away defeat.
Stevenage were ahead after just three minutes when a free-kick into the box was cleared out to Pett on the edge of the area and he cracked his first-time shot into the bottom corner.
Chances were scarce for the rest of the first half but Bira Dembele almost doubled the lead when he acrobatically hooked Simon Walton’s corner over the bar.
Chris Day then preserved the hosts’ advantage four minutes after the restart by tipping Dan Butler’s effort around the post after the winger had been played in by James Dunne.
Portsmouth thought they had an equaliser with 20 minutes left when Craig Westcarr turned in Butler’s terrific cross only for him to be flagged offside.