I do not think that this is reasonably doable. While OP does not provide his onward carrier, UA or NH, both have the same drop dead time of T-30 for boarding. Thus, OP has 21 minutes, not 51 minutes to make it from seated on his inbound aircraft to the gate reader for his UA/NH flight.
That is theoretically doable if the inbound is truly ontime, OP is one of the first few people off his aircraft (and has nothing gate-checked for which he must wait), can move at somewhat of a trot-run, and makes no wrong turns.
The other issue here, as with all connections, is what happens if there is a misconnect (I am presuming that OP is on one ticket XXX-IAD-NRT, but he uses the term "layover" rather than "connection"). If the next flight to NRT was an hour later and is generally open, this would not matter. But, it's not. Practically speaking, the next flight will involve routing through ORD or the West Coast and may well result in truly lousy seats and very poor availability. The distinct possibility here is that OP is stuck for a day at IAD.
I would not advise booking this connection and would strongly advise an earlier flight (and if none, the night before) unless OP's schedule is such that he truly cannot travel earlier.
OP - What is your origination airport?