Jack Turner scored a double as Queen's Park ended a run of three straight defeats and Livingston suffered a third consecutive loss of their own to drop to third in the Scottish Championship table.
Turner fired low into the far corner from outside the penalty box to put the hosts into an 11th-minute lead at Hampden.
Livingston were presented with a chance to equalise four minutes after the break when Henry Fieldson fouled Michael Nottingham, but on-loan St Johnstone striker Stevie May fired the resulting penalty kick off the crossbar.
They were made to pay for that within another three minutes when Turner headed in from Jack Thomson's cross for the midfielder's 11th goal of the season.
Queen's Park midfielder Zach Mauchin was sent off after picking up a second yellow with 20 minutes remaining.
However, the Glasgow side survived late pressure to move to within four points of fourth-placed Partick Thistle, while Livingston remain six adrift of leaders Falkirk having played a game more as Ayr United move two points above David Martindale's side after their 3-0 win over Raith Rovers.