Valley left it late to seal a tricky encounter at Compton Park when substitute Kurtis Revan grabbed the winning goal with three minutes of normal time remaining.
Danico Johnson had given the visitors an early lead, but they then missed a number of good first half chances before gifting United an equaliser ahead of the interval.
Rugby boss Carl Adams made three changes from the side beaten at home to Quorn the previous weekend, with Lee Thomas, James Hancocks and Justin Marsden in from the off, and Town made the perfect start when Johnson helped the ball home after Cogenhoe keeper Shay Griffiths had spilled his initial flicked contact to Ryan Seal's near post free-kick.
Marsden's well-struck effort from the edge of the penalty area was then deflected over for a corner, as Valley remained on top.
Johnson was soon back in the action bursting into the United box, but - having chose to lay the ball off rather than shoot - his attempted pass to Seal was not gathered by Rugby's leading scorer.
In the first of a series of four headed attempts, Loyiso Recci headed Seal's corner over, whilst at the other end Town's back-line were looking relatively comfortable against the hosts' direct counter-attacking tactics.
Jamal Clarke was the next to miss out with his head, when he put Keenah Rosser's cross onto the bar and then the same player nodded weakly wide after Seal had picked him out with another corner.
Cogenhoe drew level on 36 minutes after a series of defensive calamities allowed Nat Ansu a free run at goal, and the lively striker made no mistake by rolling the ball past Matt Hill.
There was still time for another squandered header ahead of the break though, when Liam Francis put one over at the far post after a period of sustained pressure from Rugby.
The home side started the new period well, with Carter Price having a volley blocked and then Hill was down well to save a low shot from Ceepy Logongo.
Town's cause was hindered when Dylan Parker was sin-binned for ten minutes for dissent just after the hour mark, but his return plus a double substitution which saw the arrival of the two Cain(e)s - Thomas and Elliott, saw Rugby back in the ascendance.
Another strong run from Johnson again ended with an incomplete pass to Seal, whilst Marsden's effort from distance struck a United body before drifting behind for a corner.
When Griffiths pulled off an impressive one handed save to Seal's effort, it appeared that Rugby may have to settle for a point, but they managed to secure all three when Revan powered home after Clarke had seen his shot blocked following a long throw into the box by Cain Thomas.
Line-up: Hill; Clarke, Francis (Revan), Recci; Rosser, L.Thomas, Hancocks (C.Thomas), Marsden (Elliott), Seal; Parker, Johnson. Subs not used: Padmore. Booked: Parker (Sin Bin).
Cogenhoe line-up: Griffiths, Bates, Mullally, Price, Rich, Cichosz, Culley, Cirelli, Logongo, Ansu, Orosz. Subs: Nkrumah, Gillingwater, l'Anson, Gbejuade.