Crocker began the day with a two-shot lead but was joined at the summit early on as the chasing pack closed in on him at Fairmont St Andrews.
He led by one at the turn before starting the back nine with three birdies in four holes to reach 22 under par and stretch his advantage to two.
But with Englishman Pepperell in the clubhouse on 21 under, Crocker endured a nervy finish as he parred his way home to sign for a closing 68 and win by a single shot.
Crocker, who started the 2022 season with eight missed cuts and a retirement in his first nine events, was visibly relieved as he holed his four-foot par putt at the last to secure the trophy.
Pepperell finished alone in second one shot behind Crocker after firing a brilliant Sunday 65, while home favourite David Law and Adrian Otaegui shared third place on 19 under.
Crocker showed great fighting spirit in the early stages of his fourth round, saving par from ten feet at the second to stay at 18 under.
He got his first birdie of the day from close range at the fourth after hitting the flag with his chip shot and holing the two-foot putt that followed.
The American gave the shot back at the short fifth but made amends at the very next hole with a two-putt birdie from 32 feet.
Crocker closed the front nine with three straight pars to lead by one at the turn.
Two fantastic shots into the tenth set up an eight-foot birdie chance which Crocker duly converted to reach 20 under.
He saved par from five feet at the 11th before taking advantage of the par-five 12th for a fourth birdie of the day.
That briefly extended his lead to two shots but the charging Pepperell got his third birdie in four holes at the 15th to close the gap to one.
Crocker re-established his two-stroke advantage at the top as he trickled in his 15-foot birdie try on the 13th green for back-to-back gains.
He gave himself another good birdie chance at the 14th but his 12-foot effort slid just by.
Crocker drove the 15th green but had to settle for a three-putt par there after his birdie attempt lipped out.
Pepperell birdied the 18th a few holes ahead to set the clubhouse target on 21 under and close the gap to Crocker to one shot once more.
The leader stayed aggressive and created yet another chance for himself at the 16th but was not able to find the cup from 17 feet.
He produced a nerveless par save from seven feet at the tricky 17th to head to the 18th with a one-shot lead.
After sending his tee-shot into the left rough, Crocker faced a difficult two-putt for par from the bottom tier of the green.
But he gave himself a four-foot putt which he managed to hole to enter the winner's circle.
Crocker said: "Winning a golf tournament is not easy. And Eddie did not make that easy for me either.
"After the three-putt par on the 15th I kind of thought I still had a little bit of room but they're not easy holes coming down that stretch.
"It was a great save on the 17th, and then I thought I could make it pretty easy - it's a par five coming in - but I don't think it's ever easy to make a par to win a golf tournament. That was pretty special.
"I was nervous. I've felt pressure like that before but it's my first pro tournament (win). That putt looked like it was 20 feet, that hole looked like it was half-an-inch wide.
"Right off the face I knew it was a well-struck putt and as I looked up and I saw it drop I was telling myself 'don't start crying'.
"It's awesome. It just shows you that you just don't know what this game is going to bring you.
"We go out there every day trying our hardest and we can play terrible for a long time and then all of a sudden you have a week like this where every bounce seemed to go my way, putts dropped, I hit the ball beautifully and it just makes me appreciate this game I play and what I get to do for a living.
"I hope I keep putting myself in this position. That door has been locked shut for me for almost five years. To go wire to wire I think I knocked the door clean off its hinges, which is nice."
Pepperell started brightly on day four, birdieing the second, fourth, sixth and seventh before dropping his only shot of the day at the ninth.
He picked up three birdies in four holes from the 12th to keep the pressure on Crocker before another gain at the last saw him set a testing target.
The 31-year-old was pleased with his day's work, saying: "I am proud. It was pretty flawless until the ninth.
"Then it felt far from flawless for a few holes there and I had to really think about it and figure it out. Then there were some tough tee-shots for me but I really just trusted my routines and from the fairway in I felt like I played great.
"And I just trusted myself really. I haven't been in this position for a long time but I've always felt when you're in this position it's a case of trusting your body, it's responding well, you just need to allow it to do what it has been doing.
"That was the hardest part about today but by and large I think I've done a good job."
Dane Oliver Hundebøll and Swede Jens Dantorp finished in a tie for fifth on 18 under.