Lockyer, back in the Town line-up for the first time since the Cardiff fixture in November, netted from a James Bree cross in the first half to put the Hatters ahead.
Andreas Weimann scored an equaliser in the second half for the Robins, after being found by Antoine Semenyo.
Adebayo scored his 12th goal of the season to put Town back in front, stabbing home from close range after another Bree cross.
Nathan Jones made six changes to the side that started Saturday’s trip to Sheffield United. Lockyer came in for Sonny Bradley, who dropped out through injury. Elsewhere in defence Bree comes in for Peter Kioso, with Gabe Osho replacing the suspended Reece Burke.
Glen Rea takes his place in midfield, alongside the returning Luke Berry who makes his first start since the win over Hull City in October. The sixth change sees Adebayo return up-front, with Admiral Muskwe partnering.
The game, with Town sporting their white 'Legends' kit in support of Shelter’s No Home Kit campaign, had a cagey opening half hour, with neither side registering a clear effort on goal.
Town sparked into life ten minutes before the break, with Adebayo spinning beyond Zak Vyner. His ball across the box could’ve gone anywhere, but it was diverted out for a corner by Tomas Kalas.
From the resulting corner, Rea had a free header but was unable to direct goalwards as it went wide of Max O’Leary’s post.
The Hatters continued to grow into the game as the first half came to a close, and took the lead through Lockyer’s header. After a short corner, James Bree’s cross into the area was perfect for the header to head in the opener, his first goal for the club.
After a quiet opening 10 minutes into the second half, the visitors would find their equaliser. Weimann was given too much time and space after being found by Semenyo, and slotted beyond James Shea.
Bristol City then came close to finding the lead. Cameron Pring’s effort looked like it had been touched over the bar by Shea, but the referee gave a goal kick Town’s way.
On the hour mark, Town made their first changes of the game. Allan Campbell and Fred Onyedinma were introduced in the place of Berry and Muskwe.
Town would then go back in front through Adebayo. Bree’s free-kick caused havoc in the Bristol City area, with Adebayo reacting quickest to stab the ball across the line.
Entering the final ten minutes of the game, the visitors had another sighter on goal. Weimann’s twist and volley went over Shea’s crossbar.
With five minutes of regular time remaining, Lockyer’s return was over, with Peter Kioso coming on in his place.
Seven minutes of stoppage time were added by the fourth official, with Town looking to hold onto the three points.
Late on, Bristol City could have snatched a point after Weimann’s header across goal gave Nakhi Wells an easy finish, but the striker could only find the outside of the post.
Despite the late chance for the Robins, it would be Town who claimed the victory and all three points courtesy of Lockyer and Adebayo.
Goals:
Town: Lockyer (42’)
Bristol City: Weimann (55’)
Att: 9,202 (586 away)