Colchester went close in the ninth minute through Freddie Sears, whose curling effort came back off the crossbar following Sanchez Watt's slide-rule pass.
Doug Loft's half-volley whistled past the far post for Vale, but keeper Chris Neal had to push away Massey's effort for a corner after a good U's move.
Neal denied Sears and Jabo Ibehre knocked a rebound effort wide after Watt's lofted pass had caused problems for the Vale defence.
Colchester went close just after the break through Sears, whose low shot flashed wide of the far post while at the other end Chris Lines saw his effort fly narrowly past the woodwork.
Ibehre fired straight at Neal before Colchester scored their winner with 16 minutes to go through Massey, who converted from close range after Neal had saved Ibehre's low shot with his legs.