Cochrane was on the bench with Walker at Dens Park but was introduced midway through the first half after Stephen Kingsley limped off with a nasty-looking shin injury.
With Hearts on top but not looking particularly threatening, head coach Robbie Neilson turned to Walker in the second half to produce the attacking spark that was needed to win the game.
The 28-year-old attacking midfielder provided it, going close with a volley before popping up to fire home the winning goal.
It was his 54th goal for Hearts and his outbreak of emotion in front of the Hearts fans showed how much it meant.
Walker has had to bide his time for months but took his chance when it came in what was his first appearance since September 18.
It was Cochrane’s zipped pass into Barrie McKay which led to the goal, the ball eventually breaking to third sub Aaron McEneff. His deflected shot came back off the post for Walker to fire in the rebound from close range.
“It couldn’t have happened to a better player,” Cochrane told the Edinburgh Evening News. “Everyone is buzzing for Jamie Walker.
“He’s a goalscorer at the end of the day. He knows what positions to get into and he’s clinical in those positions. He took his goal well and it came at the right time.”
Walker faces an uncertain future with his contract expiring in the summer and Livingston and St Johnstone interested in taking him on loan in January.
Neilson said he would like to keep him and Walker himself said he would be “delighted” to stay if he is given more opportunities to play.
Cochrane, for one, would like to see him stay. Walker is a popular figure in the dressing room and has to bide his time for an opportunity.
“His attitude in training has been top class,” added Cochrane. “He’s giving 100 per cent every day and he’s a top guy so everyone is buzzing for him.”