Story of the match
Accrington Stanley were the first to try their luck as Mitch Clark and Rich-Jay Bagheulou had chances.
Matt Butcher then saw his shot blocked, his second effort palmed onto the roof of the net by goalkeeper Dimitar Mitov.
The Cambridge ‘keeper then beat away a header by Colby Bishop with the forward's next shot deflected away.
The visitors threw all sorts of set pieces and diagonal balls at their hosts with Cambridge dealing with them well.
Clark found space in the box and struck the outside of the post late in the first half. Sean McConville, Ethan Hamilton and Tommy Leigh all saw shots blocked.
The visitors were nearly in front on 65 minutes as Baghuelou's flick-on from a throw-in was cleared off the line by Sam Sherring.
Just a minute later, Cambridge opened the scoring as Adam May's strike was parried into the path of Smith, who slotted home for his 14th goal of the season.
Rich-Bagheulou then nearly scored into his own net, diverting George Williams' cross onto the crossbar before Mitov tipped Korede Adedoyin's effort around the post at the other end.
Knibbs then fired into the side netting after being through on goal and Hoolahan dragged his shot wide.
Both goalkeepers produced fine saves, Mitov denying Bishop while Savin saved from Brophy.
The victory was secured when Brophy teed up Hoolahan, who slotted home on the counter to pick up three much-needed points.
Man of the match: Wes Hoolahan
He was involved in nearly every dangerous attack Cambridge had and rounded off a fine performance with a well-deserved goal.
The former Norwich City man showed his quality and experience in playing at higher levels when Cambridge needed a performance like this from him.