Liverpool raced into a 3-0 lead before half-time, with Michael Essien’s own goal, Jordan Henderson’s strike and Daniel Agger’s header putting the home side in control.
Stewart Downing missed a penalty just before the break and Ramires pulled one back for the visitors shortly after the restart.
But Shelvey cemented the Reds’ advantage with a spectacular long-range effort after Chelsea goalkeeper Ross Turnbull mis-kicked his clearance into the midfielder’s path.
The win provided some consolation for Kenny Dalglish’s side, who suffered a 2-1 defeat by the Blues in the Wembley showpiece on Saturday.
“I’m delighted to score my first Premier League goal, especially at Anfield,” Shelvey told Liverpool’s website.
“It was a great performance from the team and we started off really well. If we’d been able to do that on Saturday, it may have been a different story and we’d have the FA Cup as well.
“I saw the keeper mis-kick and the ball fell on my right foot. I heard the crowd shouting ‘shoot’, so I thought, ‘Why not?’
“It came off sweetly and went into the back of the net.”
“It’s been a stop-start season at home and we’ve not punished teams as often as we would have liked, but to beat Chelsea, who are going into the Champions League final, 4-1 in one of our last games of the season is an achievement.”
Shelvey, who was named the Football League Young Player of the Month for November after an impressive two-month loan spell at Blackpool, has made 12 league appearances this season and the 20-year-old considers his performance against Chelsea to be the highlight of his career to date.
“I think it was one of my best games for Liverpool,” he added.
“It’s nice to play, and the more and more you do, the more used you get to the match fitness and sharpness. I felt I proved I am worthy of getting another game. Hopefully I can get another one on Sunday.
“Personally, I think I’ve done OK [this season]. I went on loan and enjoyed my time at Blackpool. I came back here and have challenged for a place. Hopefully I can cement one next season.”
MORE: Man United latest news
MORE: Arsenal latest news
MORE: Chelsea latest news
MORE: Liverpool latest news