Stanley Mullin said an officer had "tears in his eyes" as he said he could not do any more for Eric Hughes, 42.
The policemen gave mouth-to-mouth and heart massage to the father-of-two from Warrington, while Mr Mullin rubbed his friend's hand, saying: "Come on, Eric!"
The court also heard about the final movements of 18-year-old Paul Clark.
Mr Mullin and Mr Hughes had travelled to Sheffield on 15 April 1989 to watch Liverpool play Nottingham Forest in the FA Cup semi-final.
Mr Hughes' son David, who was 17 at the time of the disaster, previously told the court how his father - who had worked as a lorry driver, a taxi driver and a salesman - was nicknamed "Eric The Red" because of his devotion to Liverpool FC.
He told the hearing of his sorrow that his father had not lived to meet his grandchildren, and that he never "got to buy my dad a pint".
The friends went into pen three together on the Leppings Lane terraces but were separated after a crowd surge, the hearing was told.
Mr Mullin managed to escape through a gate at the front of the stand, which he said had been opened by a police officer.
He later saw Mr Hughes being lifted off the terraces and laid on the pitch. The jury heard he was placed near the goal line at 15:26 BST - 20 minutes after the match was halted.
PC Neil Mutch was giving Mr Hughes chest compressions while his colleague PC Barbara Hardwick - now Barbara Woodward - gave him the kiss of life.
Mr Hughes was unresponsive, the jury heard.
Mr Mullin said: "I was rubbing Eric's hand. I was talking to Eric while rubbing his hands, saying, 'Come on Eric! Come on!'"
Mr Mullin said the officers, who were both crying, eventually stopped.
He said: "The chap just looked up at me with tears in his eyes and said: 'I'm sorry I can't do any more.' They were so upset."
In a statement, Mr Mutch said that after seeing Mr Hughes he was "in a very bad state", while Mrs Woodward was "very upset".
Mrs Woodward told the court she had "blocked out" a lot of what happened on the day of the disaster.
The court heard how the officers stopped giving first aid after a man who said he was a doctor told them Mr Hughes had died.
Paul Clark was an apprentice electrician from Derbyshire. His parents described him as a "lovely young man" who was "fun-loving and caring".
He went to the match with his father, Kenneth, and a friend, Andrew Booth.
Mr Booth, who was with his friend inside pen three, said Mr Clark moved towards the front of the enclosure shortly before kick-off.
"I would have said he was pushed forward by the crowd," Mr Booth said.
He did not see his friend alive again and said that after kick-off the pressure in the enclosure intensified.
Matthew Hill, a barrister representing the coroner, said there was no video or eyewitness evidence showing how Mr Clark made it off the terraces.
After the disaster Mr Clark's father, who had a seated ticket for the match, waited for his son at a meeting point. When he did not turn up, he went to a nearby police station for help.
Mr Clark eventually called his wife, Susan, who travelled to Sheffield that evening.
They later identified their son's body in the stadium's gymnasium.
The inquests, in Warrington, Cheshire, are due to resume on Thursday.
BBC News: Profiles of all those who died
Two police officers wept as they tried to resuscitate one of the 96 fans fatally injured at Hillsborough, one of his friends told the new inquests jury.