It is false. The Wikipedia article on degree sequence has a counterexample with 8 vertices:
The two graphs are loopless and connected, and each has 3 vertices of degree 1, 4 vertices of degree 2, and 1 vertex of degree 3. A similar example has 6 vertices. (just delete two of the order-2 vertices in each graph.)
(An earlier post by Alexander Gruber points at this paper, “Trees
numbers” which is relavant here.)
Addendum: The minimal counterexample has only 5 vertices and 5 edges:
Because it's so small, it can be found by hand in a few minutes by simply enumerating all graphs. This suggests that next time you have a conjecture, you might do well to try checking it for small graphs. If you haven't previously tried to draw all the small graphs, this suggests that learning to do that would be a good investment of effort.