Michael Doyle's 50-yard strike with the last kick of the game sent us through to the third round of the Buildbase FA Trophy.
After a first half in which we hit the post and bar and had a goal chalked off, Kristian Dennis netted his second in as many games in the competition to put us ahead shortly after the break.
Mitch Brundle scrambled home an equaliser 14 minutes from time but our skipper nonchalantly caught Elliot Justham out from halfway to score his first goal for the club and win it at the death.
Neal Ardley had suggested he'd make changes in the build-up and he was true to his word, with only Wes Thomas, Sam Osborne, Doyle, Alex Lacey and Damien McCrory keeping their places in the XI - the latter moving into the centre of defence.
Dion Kelly-Evans and Zoumana Bakayogo came into the full-back positions to form a four-man backline in front of Ross Fitzsimons, while Tom Crawford and Sean Shields, who had been absent with an injury since 21 December, completed the midfield.
We were the quicker out of the blocks and Thomas called Justham into action with a relatively easy save, before Shields' cross struck the bar after good link-up play down the left.
Doyle had an excellent opportunity to put us ahead on 15 minutes, when Kelly-Evans' ball in evaded Dennis and broke for the Irishman, who controlled 12 yards from goal. He dragged his shot wide, though, spurning the chance to open his account for the club.
We had the ball in the net on 17 after Osborne won a free-kick following a clever nutmeg on Liam Gordon, who was booked. Doyle rolled the set piece short for Shields, who in turn cut back for Thomas and his effort was diverted home by Dennis. However, referee Andrew Miller ordered the kick to be retaken, presumably he felt it was taken before his whistle.
Sam Deering's neat feet got him into a position to shoot from the edge of the box on 21 minutes but Fitzsimons got down to his left to make a comfortable save and keep out Dagenham's first effort of the afternoon.
Justham was called into more meaningful action at the other end on 26, when Bakayogo picked out Osborne on the right side of the box and the winger struck powerfully towards the top corner but the keeper was equal to it at his near post and pushed the ball behind.
Just after the half-hour, Dagenham should have taken the lead. Their best move of the game came down our left and culminated with Matt Robinson firing a dangerous low ball across our area, where an umarked Joe Quigley met it at the back post. Meadow Lane breathed a collective sigh of relief as he shot wide when it looked easier to score.
We pressed to break the deadlock as the opening period drew to a close and struck the frame of the goal on 39 minutes, when Dennis cushioned the ball down into Thomas' path for a left-footed volley, but his effort cannoned back off the upright.
He fastened onto a knock in behind moments later and went down in the area - nothing doing said Miller.
Inside the final five minutes of the half, Deering sent a long-range half-volley narrowly wide of Fitzsimons' left post as the visitors showed it was not all one-way traffic.
But, just before one minute was added on for stoppages, we claimed the last chance of the opening period when Dennis got in behind the Daggers defence and worked the ball onto his right foot, but he could only drag his shot across the face of goal.
Play resumed with no changes for either side, but Osborne nearly made a quick alteration to the scoreboard when he was released on the right-hand side of the area. His low cross-shot had too much on it for Dennis to reach at the back post and was just off-target, too.
Brundle curled an effort wide, which Fitzsimons had covered, before Thomas was denied another penalty shout when he went down under challenge from Kenny Clark.
But the home faithful were not to be kept waiting much longer for a breakthrough.
Dennis made it on 53, applying the finish to Bakayogo's inviting low cross from the left for his 11th of the campaign.
Doyle seemed in the mood to open his Notts account and his fierce drive whistled just past the post after Thomas perfectly teed him up as we very nearly added a swift second.
And the openings kept coming before the hour, with Chike Kandi heading Will Wright's cross into the side netting as Dagenham chased an equaliser.
Thomas was next to go close with 64 played, with Kelly-Evans' attacking intent getting him in a great position to cut the ball back for the striker. He curled it towards the bottom left corner, but saw his shot roll agonisingly wide.
Justham held onto an effort from Shields and Doyle made a good block on Brundle before Fitzsimons was called into serious action for the first time, getting a strong left hand to Quigley's shot on the turn.
But, despite the keeper's best efforts, Dagenham restored parity on 76 minutes.
Wright's whipped free-kick picked out Brundle and Fitzsimons made a phenomenal point-blank stop to turn his effort onto the bar, and an even better one to keep out the follow-up. But a scrambled ensued, and eventually the linesman raised his flag to indicate the ball had crossed the line - Brundle wheeled away to take the credit.
Ardley immediately looked to his bench, sending Kyle Wootton, who this week signed permanently from Scunthorpe, and Enzio Boldewijn on in place of Dennis and Shields.
Justham held onto Thomas' flicked volley and Deering's weaving run led to him firing wide as both teams sought to avoid a replay.
The Dagenham keeper made a huge stop to keep his side level when good work from Bakayogo led to Wootton feeding Osborne. The winger checked inside his man to work room for a left-footed shot in the box, but Justham made himself big and used his body to keep the effort out.
Three minutes were added on for stoppages and deep, deep into them Justham raced out of his goal to beat Thomas to a ball in behind. His clearance went right into the path of Doyle in the centre circle and he floated the ball over back-pedalling defenders and the keeper to send Meadow Lane wild.
There was barely time for play to restart, and the final whistle was barely heard as the pandemonium continued in the stands, but it did sound and confirmed our place in round three.