Jordan White scored goals either side of the break before substitutes Myles Hippolyte and David Robertson added gloss to the scoreline. The Tynecastle side's consolation was courtesy of Jason Talbot's own goal.
At the start of a period in which the Edinburgh side will play four games in 11 days, the Hearts head coach Robbie Neilson named an under-20s side effectively, making 10 changes from the team which triumphed in the Edinburgh derby on Sunday.
That allowed Livingston - coached by erstwhile Hearts manager John McGlynn - to take full advantage, although Neilson remained philosophical about the result. "It's a great learning curve for them," said the Hearts coach. "We used this tournament as a chance for the guys to go out and play and I thought for the first hour we did quite well.
"It was more of an experience for them, we're a club that's here to develop players and the only way you'll develop players is to put them into this environment. Sometimes you have to take it on the chin and lose a game like this."
Defender Jordan McGhee was the only Hearts player to retain his place from the 2-1 victory over Hibernian. Lee Hollis - signed as emergency cover ahead of the derby - made his debut in goal, with Jack Hamilton cup-tied and Neil Alexander and Scott Gallacher both out injured. Hearts also had Bryn Halliwell on the bench last night after the former St Johnstone goalkeeper signed a short-term contract just hours prior to kick-off.
By contrast, Livingston named the same starting XI which defeated Cowdenbeath in the league at the weekend. The West Lothian side went ahead after six minutes through White - Callum Fordyce heading Talbot's corner back into the box, where the ball broke to White and the towering striker managed to squeeze a shot into the net from an acute angle, with Hollis posted missing.
Hearts improved after the break to raise hopes that they could force the second-round tie into extra time. However, their growing confidence was punctured after 75 minutes when the home side added a second goal. Kyle Jacobs did well to dig out a cross from the corner flag and White raced in to power a header home from close range.
Substitute Hippolyte added a third with a fine individual effort after 81 minute, the teenager skipping past Brad McKay and striding ahead to rifle a low left-footed effort into the corner of the net. Hearts capitulated and Robertson got in on the act with five minutes left, waltzing through the Tynecastle defence before duly beating Hollis.
Neilson's side pulled one back when Talbot diverted Liam Henderson's cross into his own net.
"We are obviously happy in the end. Overall, it was a good performance," said McGlynn, whose side had beaten Queen of the South in the first round. "I was very surprised by their line-up, I was aware that Robbie had said he was going to make changes but I never in my wildest dreams thought he was going to make as many changes.
"But the fear then was that our players [would] look at the team sheet and think 'it's just young players' and then have the wrong attitude."