Centre-back Lockwood gave the Shakers the lead 18 minutes into the first half, his left-footed shot went through an army of bodies in the penalty area before finding the bottom corner.
The home side should have doubled their lead from the kick off in the second half when Troy Hewitt missed a one-on-one with the goalkeeper, sliding his shot wide of goal.
But Bury made it 2-0 after 55 minutes when the linesman gave a penalty after he believed Dominic Poleon had been unfairly challenged in the area by Carl Dickinson much to the fury of the Portsmouth players.
Bury skipper Steven Schumacher stepped up and placed the spot kick to the right of Mikkel Andersen in the Portsmouth goal.
Portsmouth were restricted for much of the match with shots from long range. Izale McLeod and Carl Dickinson both had decent attempts on goal, but failed to trouble Bury goalkeeper Trevor Carson.