Cambridge United ended a four-game losing run to consign Stockport to their first home defeat since December.
The hosts started brightly but were undone when James Jennings's long ball found Mustafa Tiryaki, who showed good strength before finishing.
The Hatters were handed a penalty when U's keeper Danny Naisbitt brought down Tom Elliott, but Danny Rowe missed the resulting spot-kick.
Andy Pugh and Tiryaki failed with late chances to double Cambridge's lead.
VIEWS FROM THE DRESSING ROOM
Cambridge United boss Jez George told BBC Radio Cambridgeshire:
"We have struggled along in the last few games and we've been criticised.
"It's a results business and we wanted to get the right result for the club and for the supporters. The players are a great bunch who are honest and work hard.
"We had a little bit of luck with the penalty save but I am just relieved with the result."