St Johnstone changed things at half-time and Murray Davidson headed in before Liam Craig scored the rebound after Sean Murdoch parried his penalty.
However, with both sides pushing for a winner, Wesolowski slid the ball home from a tight angle to win the match.
St Johnstone manager Derek McInnes had made two changes, defender Graham Gartland and striker Steven Milne both making their first start for two months with Liam Craig also recalled.
Accies, meanwhile, named the same starting 11 for the third match in a row.
Portuguese forward Marco Paixao had the first chance from a free-kick, but Saints keeper Graeme Smith acrobatically tipped it over the bar.
However, Saints struggled to clear the resultant corner and defender Mark McLaughlin pounced on Alex Neil's high hook to head the ball over Smith and into the net.
The visitors were on top and Simon Mensing should perhaps have done better when Dougie Imrie played a great cross across the face of goal only for the former Saints man to fail to connect.
Hamilton's players claimed for a penalty when Imrie was fouled right on the edge of the box, but referee Willie Collum decided the offence took place just outside the area.
Imrie curled the resultant free-kick round the wall into the top right-hand corner of the net to double the visitors' advantage.
Saints had a rare glimpse of goal when Steven Milne tried a dipping effort from 25-yards, but Murdoch was alert to the danger and tipped the ball wide.
The Saints fans were left in uproar when Murdoch appeared to pick up the ball outside the box, but the match officials gave the Accies keeper the benefit of the doubt.
Home manager Derek McInnes changed tactics at half-time, bringing on striker Kenny Deuchar for Gartland, and the move paid instant dividends when Davidson headed home Chris Millar's cross to bring Saints back into the match.
Hamilton still looked dangerous and were left three on three with the Saints defence. But, with two team-mates waiting in the box, Marco Paixao blasted wide from a tight angle.
Imrie whipped in a great free-kick as Accies went back on the offensive only for Marco Paixao to head over from three yards out.
Murdoch was penalised for handling outside the box, much to the delight of the home support, but Liam Craig failed to make anything of the free kick.
Saints were handed a terrific chance to level when Deuchar went down under the challenge of Murdoch in the Hamilton box and referee Collum pointed to the spot.
Murdoch parried Craig's penalty, but the left-footed former Falkirk midfielder was alert to net the rebound.
The game remained open, with Joel Thomas passing up a great chance when Wesolowski cut the ball back to him at the penalty spot only for the striker to blaze the ball over.
Wesolowski wasn't finished, however, and, after being fed the ball in the box by Imrie, he slid it under Smith from a tight angle to win the match - and seventh place - for Accies.
Passions boiled over as the home side searched for an equaliser and McInnes was sent to the stand in the final minute of the match.
Live text and stats
Saturday, 8 May 2010
Scottish Premier
Home Team
Score
Away Team
Time
St Johnstone
2-3
Hamilton
FT
(HT 0-2)
Davidson 49
Craig 68
McLaughlin 8
Imrie 15
Wesolowski 84
St Johnstone
25 Smith
03 Grainger
12 MacKay
18 Gartland (Deuchar 46)
28 Duberry
04 Morris
07 Millar (Irvine 77)
10 Craig
20 Davidson yellow card
09 Milne
21 Samuel (Sheerin 85)
Substitutes
45 Duffy,
02 Irvine,
05 Rutkiewicz,
11 Sheerin,
17 Deuchar,
23 Jackson,
26 Sheridan
Hamilton
19 Murdoch yellow card
02 McClenahan
04 Canning
06 McLaughlin (Elebert 88)
07 Wesolowski
08 McArthur
27 Mensing
10 Neil
18 Flavio Paixao
21 Marco Paixao (Thomas 70)
23 Imrie
Substitutes
50 Potter,
05 van Zanten,
25 Elebert,
36 Crawford,
33 Wilkie,
26 Thomas,
28 Kirkpatrick
Ref: CollumAtt: 3,188
ST JOHNSTONE HAMILTON
Possession
St Johnstone 53%
Hamilton 47%
Attempts on target
St Johnstone 8
Hamilton 6
Attempts off target
St Johnstone 5
Hamilton 4
Corners
St Johnstone 13
Hamilton 3
Fouls
St Johnstone 10
Hamilton 18
Final Result
Full Time
90:00+4:25 The referee blows for the end of the match.
90:00+3:51 The ball is swung over by Daniel Grainger, free kick awarded for a foul by Kenny Deuchar on Martin Canning. Sean Murdoch takes
the direct free kick.
90:00+3:09 Daniel Grainger crosses the ball, clearance by Simon Mensing.
90:00+2:37 Inswinging corner taken from the right by-line by Daniel Grainger, Simon Mensing manages to make a clearance.
90:00+1:28 David Elebert gives away a free kick for an unfair challenge on Kenny Deuchar. The free kick is delivered left-footed by Liam
Craig from right wing, Simon Mensing makes a clearance.
Correction - 90:00+0:39 Jody Morris concedes a free kick for a foul on James Wesolowski. Sean Murdoch restarts play with the free kick.
90:00+0:39 Free kick awarded for an unfair challenge on James Wesolowski by Jody Morris. Free kick taken by David Elebert.
90:00+0:26 Liam Craig sends in a cross, Simon Mensing makes a clearance.
88:10 Liam Craig fouled by Joel Thomas, the ref awards a free kick. Graeme Smith takes the direct free kick.
87:05 Substitution David Elebert is brought on as a substitute for Mark McLaughlin.
86:04 Effort from deep inside the area by James Wesolowski clears the bar.
85:28 The ball is crossed by Steven Milne, Sean Murdoch makes a comfortable save.
84:30 Substitution Paul Sheerin comes on in place of Collin Samuel.
83:49 Assist on the goal came from Douglas Imrie.
83:49 GOAL - James Wesolowski:St Johnstone 2 - 3 Hamilton Goal scored by James Wesolowski from close in low into the middle of the goal. St Johnstone 2-3 Hamilton.
83:46 The ball is sent over by Douglas Imrie,
79:46 The ball is delivered by Flavio Paixao, Michael Duberry makes a clearance.
78:48 James Wesolowski produces a cross, Shot from deep inside the area by Joel Thomas clears the bar.
77:03 Centre by Collin Samuel, Simon Mensing makes a clearance.
76:02 Graeme Smith restarts play with the free kick.
76:02 Substitution Gary Irvine on for Chris Millar.
76:02 The referee blows for offside against Mark McLaughlin.
75:22 Free kick crossed right-footed by Flavio Paixao from right wing, Michael Duberry manages to make a clearance.
75:22 Booking Murray Davidson receives a caution.
75:19 Murray Davidson concedes a free kick for a foul on Flavio Paixao.
74:29 Corner from the left by-line taken by David MacKay, free kick awarded for an unfair challenge on Mark McLaughlin by Michael
Duberry. Direct free kick taken by Sean Murdoch.
73:59 Inswinging corner taken right-footed by David MacKay from the left by-line, clearance made by Simon Mensing.
73:41 Corner from the right by-line taken by Daniel Grainger, clearance made by Flavio Paixao.
72:43 Unfair challenge on Steven Milne by Alex Neil results in a free kick. Jody Morris produces a strike on goal direct from the
free kick, Sean Murdoch makes a save.
72:05 Chris Millar takes a long range shot clearing the bar.
71:39 Corner taken by David MacKay from the left by-line, James McArthur makes a clearance.
70:47 David MacKay takes the inswinging corner, Kenny Deuchar takes a shot. Blocked by James McArthur.
69:05 Substitution Joel Thomas comes on in place of Marco Paixao.
68:45 Kenny Deuchar has a shot on goal from outside the box which misses left.
67:43 GOAL - Liam Craig:St Johnstone 2 - 2 Hamilton Liam Craig fires in a goal from inside the six-yard box to the bottom left corner of the goal. St Johnstone 2-2 Hamilton.
66:38 Penalty taken by Liam Craig is saved by Sean Murdoch. St Johnstone 1-2 Hamilton.
66:38 The ball is delivered by Chris Millar, Foul by Sean Murdoch on Kenny Deuchar, Penalty awarded.
63:56 The ball is delivered by Collin Samuel.
62:30 Free kick crossed left-footed by Liam Craig from right wing, Alex Neil manages to make a clearance.
62:30 Booking Sean Murdoch goes into the referee's book.
62:09 Sean Murdoch challenges Collin Samuel unfairly and gives away a free kick.
58:18 Chris Millar delivers the ball, Unfair challenge on Martin Canning by Kenny Deuchar results in a free kick. Sean Murdoch restarts
play with the free kick.
57:04 Headed effort from close range by Marco Paixao goes wide left of the target.
56:37 The ball is sent over by Chris Millar, comfortable save by Sean Murdoch.
56:18 David MacKay takes a shot. Save by Sean Murdoch.
55:28 Effort on goal by Marco Paixao from just outside the penalty area goes harmlessly over the target.
54:00 Inswinging corner taken right-footed by David MacKay played to the near post.
51:43 The ball is crossed by Collin Samuel, Trent McClenahan gets a block in.
51:09 Marco Paixao concedes a free kick for a foul on Chris Millar. Graeme Smith restarts play with the free kick.
50:16 James McArthur has an effort at goal from 20 yards. Blocked by Murray Davidson.
49:29 Corner taken left-footed by Douglas Imrie.
48:08 Assist by Chris Millar.
48:08 GOAL - Murray Davidson:St Johnstone 1 - 2 Hamilton Murray Davidson finds the back of the net with a headed goal from inside the area. St Johnstone 1-2 Hamilton.
48:02 The ball is delivered by Chris Millar,
46:49 The ball is delivered by Marco Paixao, comfortable save by Graeme Smith.
45:01 The referee blows his whistle to start the second half.
45:01 Substitution Kenny Deuchar comes on in place of Graham Gartland.
Half Time
45:00+2:03 The first half comes to an end.
45:00+0:06 A cross is delivered by Marco Paixao, Michael Duberry manages to make a clearance.
44:20 Chris Millar concedes a free kick for a foul on Trent McClenahan. Free kick crossed right-footed by Marco Paixao, Murray Davidson
manages to make a clearance.
43:39 A cross is delivered by Douglas Imrie, Graham Gartland gets a block in.
41:53 Jody Morris fouled by Simon Mensing, the ref awards a free kick. Direct free kick taken by Graeme Smith.
36:28 James Wesolowski sends in a cross, clearance by Michael Duberry.
35:20 Graham Gartland fouled by Douglas Imrie, the ref awards a free kick. Direct free kick taken by Daniel Grainger.
34:24 Douglas Imrie concedes a free kick for a foul on Michael Duberry. Michael Duberry takes the free kick.
33:48 Centre by Daniel Grainger, Martin Canning gets a block in.
33:07 Shot from just outside the area by Liam Craig goes over the bar.
32:36 The ball is sent over by Collin Samuel, Alex Neil manages to make a clearance.
32:18 Free kick awarded for an unfair challenge on Graham Gartland by Marco Paixao. Direct free kick taken by Graham Gartland.
31:36 Jody Morris is ruled offside. Free kick taken by Sean Murdoch.
30:17 Corner taken right-footed by David MacKay, clearance made by Mark McLaughlin.
30:07 Michael Duberry takes a shot. Clearance made by Mark McLaughlin.
29:42 Free kick awarded for an unfair challenge on Chris Millar by Douglas Imrie. Liam Craig takes the free kick.
29:05 Inswinging corner taken left-footed by Daniel Grainger played to the near post, clearance by Marco Paixao.
28:58 Chris Millar sends in a cross, Mark McLaughlin gets a block in.
28:26 Corner taken left-footed by Liam Craig from the left by-line, James McArthur makes a clearance. Liam Craig delivers the ball,
save made by Sean Murdoch.
27:42 Outswinging corner taken by Liam Craig, Murray Davidson takes a shot. Clearance made by Mark McLaughlin.
26:17 James McArthur gives away a free kick for an unfair challenge on Liam Craig. Liam Craig produces a cross, Close range effort
by Murray Davidson goes wide of the right-hand upright.
25:41 Michael Duberry delivers the ball, Liam Craig has a headed effort at goal from deep inside the area missing to the left of
the target.
24:40 Martin Canning challenges Collin Samuel unfairly and gives away a free kick. Liam Craig delivers the ball from the free kick
left-footed from left wing, James McArthur manages to make a clearance.
24:09 Liam Craig delivers the ball, Martin Canning manages to make a clearance.
23:36 Steven Milne takes a shot. Save by Sean Murdoch. Corner from the right by-line taken by Liam Craig, James McArthur makes a
clearance.
21:34 Douglas Imrie concedes a free kick for a foul on Michael Duberry. Michael Duberry restarts play with the free kick.
20:55 Douglas Imrie is caught offside. Graeme Smith takes the indirect free kick.
18:58 Liam Craig crosses the ball, Alex Neil makes a clearance.
18:08 Foul by James McArthur on Steven Milne, free kick awarded. Daniel Grainger takes the direct free kick.
17:29 Shot by Flavio Paixao. Comfortable save by Graeme Smith.
16:49 Free kick awarded for a foul by Liam Craig on Flavio Paixao. Martin Canning takes the direct free kick.
16:23 The ball is delivered by Jody Morris, save by Sean Murdoch.
15:58 Corner taken short by Jody Morris.
15:45 A cross is delivered by David MacKay, Simon Mensing manages to make a clearance.
14:18 GOAL - Douglas Imrie:St Johnstone 0 - 2 Hamilton Douglas Imrie finds the net with a shot from the free kick from 18 yards. St Johnstone 0-2 Hamilton.
13:27 Graham Gartland concedes a free kick for a foul on Douglas Imrie.
11:23 Free kick awarded for an unfair challenge on Steven Milne by James McArthur. Direct free kick taken by Graeme Smith.
10:54 Inswinging corner taken right-footed by Marco Paixao from the left by-line to the near post, Murray Davidson manages to make
a clearance.
10:37 The ball is swung over by James Wesolowski, save by Graeme Smith.
10:18 The ball is crossed by Douglas Imrie.
7:20 Assist on the goal came from Simon Mensing.
7:20 GOAL - Mark McLaughlin:St Johnstone 0 - 1 Hamilton Mark McLaughlin finds the back of the net with a headed goal from inside the penalty box. St Johnstone 0-1 Hamilton.
5:58 Graham Gartland gives away a free kick for an unfair challenge on Douglas Imrie. Marco Paixao has an effort direct from the
free kick, Graeme Smith makes a save. Corner taken by Marco Paixao from the left by-line to the near post, clearance made
by Murray Davidson.
5:28 Michael Duberry gives away a free kick for an unfair challenge on Douglas Imrie. Direct free kick taken by James Wesolowski.
3:50 James Wesolowski challenges Chris Millar unfairly and gives away a free kick. Free kick crossed left-footed by Liam Craig
from right channel, save by Sean Murdoch.
1:46 Douglas Imrie gives away a free kick for an unfair challenge on Graham Gartland. Free kick taken by Graeme Smith.
0:00 The ref blows the whistle to begin the match.
Live text and data provided by The Press Association.
Source: BBC Sport
Source: BBC Sport