Glen Johnson had given the visitors the lead after 11 minutes before Mark Noble converted from the spot following a handball by Joe Allen after 36 minutes.
The Hammers went into the interval ahead thanks to a headed own goal from Steven Gerrard before the second half turnaround.
First West Ham old boy Cole levelled in the 76th minute, before number nine for the day in Luis Suarez's absence, Shelvey pressured James Collins into putting the ball into his own net three minutes later.
"I'm going to claim it (the goal), but the main thing is we got three points and it is important we kick on," Shelvey told Sky Sports 1.
"I played it (number nine) against Young Boys. I'm not a stranger to that role.
"We got a new manager (in the summer) with a different way of playing.
"It is very exciting to be in it and the longer the season goes on the stronger we will become."
A win for West Ham would have taken Sam Allardyce's side up to sixth in the table and following up last week's 3-1 win over Chelsea many had the east Londoners as favourites.
However Allardyce was pragmatic about the defeat believing his side were just unlucky to come out as losers.
"We were never in control of the game completely especially against a side like Liverpool, we were not going to dominate for the whole game," he said.
"We gave everything we could. We can't continue to play and dominate teams we play, when we did today we got ourselves in the lead.
"We just got promoted, we are in a good run of form and there are expectations from fans "
The Hammers lost influential midfielder Mohamed Diame to a hamstring injury with 17 minutes left, with his exit seemingly a catalyst for the visitor's revival.
"The loss of Diame didn't help," Allardyce added. "We lost forward momentum but we defended well and overall the goals conceded were a bit unfortunate.
"There was a wonder goal from Johnson and Cole took his well. Unfortunately for us 'Ginger' (James Collins) scored an own goal."